xmpp聊天通訊socket推聊應(yīng)用升級指南_第1頁
xmpp聊天通訊socket推聊應(yīng)用升級指南_第2頁
xmpp聊天通訊socket推聊應(yīng)用升級指南_第3頁
xmpp聊天通訊socket推聊應(yīng)用升級指南_第4頁
xmpp聊天通訊socket推聊應(yīng)用升級指南_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、Android (Android版開發(fā)者中(,)Android (Android版開發(fā)者中(,)目SDK當前版本信1目SDK當前版本信12CHANGE3升級提4升級指初始化使用新的 MYPUSHMESSAGERECEIVER(可選5第1章 SDK當前版本信SDK第2章 ChangestopWork修復(fù)部數(shù)據(jù);第3章 升級提第1章 SDK當前版本信SDK第2章 ChangestopWork修復(fù)部數(shù)據(jù);第3章 升級提第4章 升級指3.2初始ApplicationApplicationFrontiaApplicationonCreate函數(shù)中加上super.onCreate(),否則,比如如果之前沒

2、用用到自定義Applicationmanifest的action ent.action.MAINaction ent.action.MAINcategory Applicationmanifest中指定Applicationandroid:nameFrontiaApplication application!-Application的onCreatePushFrontiaApplication.initFrontiaApplication(Context 使用新的 MyPushMessageReceiver(可選新版提供更友好的接收消息的回調(diào)方法(MesssageReceiver 中),但兼容

3、原來的接收方式。 packageimportjava.text.SimpleDateFormat; import java.util.Date;importimportandroid.content.Context; import android.content.importimportPushreceiveronBindstartWorkonMessage PushreceiveronBindstartWorkonMessage onUnbindstopWork接口的返回值回調(diào)*public class MyPushMessageReceiver extends FrontiaPushMes

4、sageReceiver/*TAGtoLogpublicicfinalStringTAG=publicvoidonReceive(finalContextent)PushManager.startWork后,sdkpushserver發(fā)起綁定請求,這個過程是異步onBind 返回。*param*BroadcastReceiver*param*綁定接口返回值,0 - *param*id。errorCode0*param*userid。errorCode0*param*channelid。errorCode0*param*publicvoidonBind(ContexterrorCode,Stri

5、ng,StringuserId,StringchannelId,publicvoidonBind(ContexterrorCode,String,StringuserId,StringchannelId,StringrequestId)StringresponseString=onBinderrorCode=+errorCode+ +userId=+userId+channelId=+requestId=+Demo *paramcontext parammessage paramcustomContentString 自定義內(nèi)容,jsonpublicvoidonMessage(Contextc

6、ontextStringmessageStringcustomContentString) String messageString = 透傳消息 message= + message + +customContentString; Log.d(TAG, messageString);/ if(customContentString!=null&customContentString!=) JSONObject customJson = null;try customJson=newJSONObject(customContentString); String myvalue = null;i

7、f(customJson.isNull(mykey)myvalue = catch(JSONExceptione)/TODOAuto-generatedcatchblock Demo *paramcontext *Demo *paramcontext *paramtitle *paramdescription *paramcustomContentString jsonpublicvoidonNotificationClicked(Contextcontext,StringStringdescriptionStringcustomContentString String notifyStrin

8、g = 通知點擊 title= + title + description=+description+customContent=+/ 值if(customContentString!=null&customContentString!=) JSONObject customJson = null;try customJson=newJSONObject(customContentString); String myvalue = null;if(customJson.isNull(mykey)myvalue = catch(JSONExceptione)/TODOAuto-generated

9、catchblock Demo setTags() *paramcontext *paramsTags setTags() *paramcontext *paramsTags paramfailTags paramrequestId publicvoidonSetTags(ContextListsTags,ListfailTags,StringrequestId)StringresponseString=onSetTagserrorCode=+errorCode+ sTags+failTags=+failTags+Demo deleteTags() *paramcontext paramerr

10、orCode 0表示某些tag0表示所有tag*paramsTags paramfailTags paramrequestId publicvoidonDelTags(ContextListsTags,ListfailTags,StringrequestId)StringresponseString=onDelTagserrorCode=+errorCode+ sTags+failTags=+failTags+Demo listTags() *paramcontext Demo listTags() *paramcontext param錯誤碼。0tag0paramtags tagparamr

11、equestId publicvoidonListTags(ContextListtags,StringrequestId)StringresponseString=onListTagserrorCode=+errorCode+tags=+tags; Log.d(TAG, responseString);Demo PushManager.stopWork() *paramcontext paramerrorCode 錯誤碼。00paramrequestId publicvoidonUnbind(ContexterrorCode,StringrequestId)StringresponseString=onUnbinderrorCode=+ +requestId=+requestId; Log.d(TAG, responseString);Demo privatevoidupdateContent(Contextcontext,Stringcontent) Log.d(TAG, updateContent);StringlogText=+ logText+=privatevoidupdateContent(Contextcontext,Stringcontent) Log.d(TAG, updateContent);Stri

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論