91嫩草国内在线,韩国理论电影免费看,6969精品视频在线观看,1024在线视频精品免费,色中色污,饭冈佳奈子在线
跳至內(nèi)容
Cobub文檔中心
用戶工具
登錄
站點(diǎn)工具
工具
顯示頁(yè)面
修訂記錄
反向鏈接
媒體管理器
網(wǎng)站地圖
登錄
媒體管理器
網(wǎng)站地圖
本頁(yè)面只讀。您可以查看源文件,但不能更改它。如果您覺得這是系統(tǒng)錯(cuò)誤,請(qǐng)聯(lián)系管理員。
====== Android Developer Guide ====== Compatibility Information * Compatible with Android 2.2 and above (API 8 and above) * SDK Version v1.0 ===== Integration Guide ===== Modifiy **AndroidManifest.xml** Add Permission <code> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></code> Add components <code> <service android:name="com.cobub.toaster.push.component.PushService"> <intent-filter> <action android:name="com.cobub.toaster.push.SYNC" /> </intent-filter> </service> <receiver android:name="com.cobub.toaster.push.component.CPushReceiver" android:permission="android.permission.RECEIVE_BOOT_COMPLETED" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver> </code> **Add the code** Call the following API as soon as possible after starting app: <code> CPushInterface.initPushService(Context ctx, String UID, String host, int port);</code> ===== API Reference ===== **Initialize** <code> CPushInterface.initPushService(Context ctx, String UID, String host, int port);</code> * ctx: context parameter * UID: UID of the device, mandatory * host: PNS url or IP address * port: PNS binding port **Set Channel** This method sets tag value for terminal device. <code> CPushInterface.setChannel(Context ctx, String channelName);</code> * ctx:context parameter * channelName:channel value, here is a tag for termianl, for example “l(fā)ocation:Beijing” **Read feedback** Report to PNS that notification has been clicked (read). <code> CPushInterface.sendReadFeedback(Context context, String mid, String expired);</code> * ctx:context parameter * mid:mid in pushed message * expired:expired time in pushed message **Receive Push Content** The payload message is transferred via Broadcast. It’s needed to set a BroadcastReceiver to receive, and the Receiver needs to filter their app package name (package) of action, otherwise it can not receive the message, add the following to menifest: <code> <receiver android:name="com.cobub.toaster.push.TestReceiver" android:permission="com.cobub.toaster.push"> <intent-filter > <action android:name="com.cobub.toaster.push"/> </intent-filter> </receiver></code> The data form PNS to mobile device contains the following content: <code> mid:“XXXXXX” data:“XXXXXX” expired:“XXXXXX” channel:“XXXXXXXX” </code> In Receiver the field can be retrieved by the following methods: <code> String msg = intent.getStringExtra("data"); String expired = intent.getStringExtra("expired"); String mid = intent.getStringExtra("mid");</code> Call according to the need Read feedback interface.
en/toaster/android-developer-guide.1426748593.txt.gz
· 最后更改: 2017/07/14 11:12 (外部編輯)
頁(yè)面工具
顯示頁(yè)面
修訂記錄
反向鏈接
回到頂部
? Copyright 2012 - 2015
南京西橋科技有限公司
Western Bridge Tech Co., Ltd.
蘇ICP備13039116號(hào)-1