Hello,

I'm new to PushWoosh and trying to follow instructions.

In the Native Android SDK integration page, there's a box with "We recommend to use Fragments guide", pointing to Android SDK Fragments. So I followed the link and implemented it in my main ActionBarActivity.

Now, (I think it's when I receive a message but it's at my application startup) my application crashes:

E/AndroidRuntime(27327): FATAL EXCEPTION: main
E/AndroidRuntime(27327): Process: fr.mandark.www, PID: 27327
E/AndroidRuntime(27327): java.lang.RuntimeException: Error receiving broadcast Intent { act=fr.mandark.www.com.arellomobile.android.push.REGISTER_BROAD_CAST_ACTION flg=0x10 pkg=fr.mandark.www (has extras) } in com.arellomobile.android.push.fragment.PushFragment$1@5c7df2c
E/AndroidRuntime(27327):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:876)
E/AndroidRuntime(27327):    at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(27327):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(27327):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(27327):    at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(27327):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27327):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(27327):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime(27327):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime(27327): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
E/AndroidRuntime(27327):    at com.arellomobile.android.push.fragment.PushFragment.getPushEventListener(Unknown Source)
E/AndroidRuntime(27327):    at com.arellomobile.android.push.fragment.PushFragment.checkMessage(Unknown Source)
E/AndroidRuntime(27327):    at com.arellomobile.android.push.fragment.PushFragment.access$000(Unknown Source)
E/AndroidRuntime(27327):    at com.arellomobile.android.push.fragment.PushFragment$1.onRegisterActionReceive(Unknown Source)
E/AndroidRuntime(27327):    at com.arellomobile.android.push.utils.RegisterBroadcastReceiver.onReceive(Unknown Source)
E/AndroidRuntime(27327):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:866)
E/AndroidRuntime(27327):    ... 8 more

It's crashing the app and I have no place to catch the exception (my node is never in the stacktrace). Also as I can't catch the exception I can't have the full exception stacktrace in logcat (Or I don't know how).

I thought about the exception and tried to register to the famous missing REGISTER_BROAD_CAST_ACTION:

IntentFilter intentFilter = new IntentFilter(getPackageName() + ".action.PUSH_MESSAGE_RECEIVE");
registerReceiver(mReceiver, intentFilter, getPackageName() + ".permission.C2D_MESSAGE", null);
registerReceiver(mBroadcastReceiver, new IntentFilter(getPackageName() + "." + PushManager.REGISTER_BROAD_CAST_ACTION));

Now my app does no longer crashes, yet I do not receve messages.

I think it's strange to have to register myself, I though the PushFragment.init(this) would do it and call doOnMessageReceive for me. So I think I'm missing something big, but I can't narrow what, does someone have a hint ?

PS: That's NOT cool to ask three tags, prohibing to create new, and don't listing existing ones ! That's a hard game of guess (hard to browse pages of existing questions to find almost logical tags for the question).

asked 08 Jun '15, 15:08
mandark's gravatar image

mandark
213

Hello,

I have the sample problem. Have you got it fixed?

permanent link
answered 18 Oct '17, 18:04
sergiohlb's gravatar image

sergiohlb
11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×447
×37
×12

question asked: 08 Jun '15, 15:08

question was seen: 2,350 times

last updated: 18 Oct '17, 18:04