GCM unregister causing the application to crash

前端 未结 4 1568
别跟我提以往
别跟我提以往 2020-12-15 04:38

I\'ve implemented GCM notifications on my app. I am now trying to un-register the app when the user logs out. I am using the following code. When this code executes, it caus

4条回答
  •  庸人自扰
    2020-12-15 05:15

    Not sure this will solve your problem, but it's always a good idea to pass the application Context to third party frameworks, rather than Activity instances, as the latter can lead to memory leaks. Try this instead:

    InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
    

提交回复
热议问题