本文介绍了GcmPubSub订阅无效的appInstanceToken:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近尝试了Google Cloud Messaging Service的新主题API。但我总是收到错误无效的appInstanceToken:



这里是logcat

java.lang.IllegalArgumentException:无效的appInstanceToken:
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System.err:com.google.android.gms.gcm.GcmPubSub。订阅(未知源)
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System.err:at com.SimDetail.MainActivity $ 3.doInBackground(MainActivity.java:265)
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System.err:at com.SimDetail.MainActivity $ 3.doInBackground(MainActivity.java:255)
11-10 22:28:34.674 15742 -15983 / com.SimDetail W / System.err:在android.os.AsyncTask $ 2.call(AsyncTask.java:292)
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System .err:在java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System.err:at android.os。 AsyncTask $ SerialExecutor $ 1.run(AsyncTask.java:231)
11-10 22 :28:34.674 15742-15983 / com.SimDetail W / System.err:在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System.err:在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587)
11-10 22:28:34.674 15742-15983 / com.SimDetail W / System .err:在java.lang.Thread.run(Thread.java:818)



任何人都可以告诉我我做错了什么?
Thanks。

解决方案

解决。 :)
GCM令牌应该获得新的

否则会抛出无效的实例标记。
不适用于

虽然收到PUSH但无法订阅。


i'm recently tried new TOPICs API of Google Cloud Messaging Service. but i always got the error Invalid appInstanceToken:

here is the logcat

java.lang.IllegalArgumentException: Invalid appInstanceToken:11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at com.google.android.gms.gcm.GcmPubSub.subscribe(Unknown Source)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at com.SimDetail.MainActivity$3.doInBackground(MainActivity.java:265)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at com.SimDetail.MainActivity$3.doInBackground(MainActivity.java:255)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:292)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)11-10 22:28:34.674 15742-15983/com.SimDetail W/System.err: at java.lang.Thread.run(Thread.java:818)

can anyone tell me what i'm doing wrong?Thanks.

解决方案

Solved. :)The GCM Token should be obtain vie new

otherwise it throws invalid instance token.it is not valid with `

although it receives PUSH but can not subscribe.

这篇关于GcmPubSub订阅无效的appInstanceToken:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 01:13