1. 程式人生 > >Jpush極光推送獲取RegistrationID

Jpush極光推送獲取RegistrationID

接著上一篇的極光推送,忘了寫RegistrationID的獲取方法了。。。。
在安卓前端與後臺伺服器的連線中,除了上一篇提到的可以設定Tag和ALias之外,還可以通過繫結極光給每一個登入極光後臺成功的裝置反饋設定的RegistID,通過RegistrationID可以實現給指定的裝置推送訊息。
好了,其他的就不多說了,直接上程式碼看看吧

    JPushInterface.setDebugMode(true);//測試版為true
        JPushInterface.init(this);
        registrationId = JPushInterface.getRegistrationID(this
); Log.e("1099", "run:--------->registrationId: "+registrationId );

然後可以直接通過log日誌打印出RegistrationID了