3分鐘快速集成文檔–照抄
根據不同的開發工具選擇不同的集成方式實現
集成到本地
- 自定義廣播接收者中針對不同的字段進行處理
`
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
Log.d(TAG, "[MyJPushReceiver] onReceive - " + intent.getAction() + ", extras: " + printBundle(bundle));
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
String regId = bundle.getString(JPushInterface.ACTION_REGISTRATION_ID);
Log.d(TAG, "MyJPushReceiver接收Register id==" + regId);
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED
.equals(intent.getAction())) {
//------在這裏對要打開通知的後續動作邏輯進行處理
//思路一:在推送內容中設置type字段--拿到解析根據不同type打開不同頁面
//思路二:如何做到將不同的推送內容推送給不同的用戶------待處理
} else {
Log.d(TAG, "[MyJPusheceiver] Unhandled intent - " + intent.getAction());
}
殘篇待續