Android Question Error using parse library and push notification

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Hello,
using parse library with the demo project attached,

I noticed that if I add this line to the manifest, the app crash

B4X:
SetApplicationAttribute(android:name,"anywheresoftware.b4a.objects.ParseObjectWrapper$ParseApplication")

and If I delete it, I've got this error:

B4X:
LogCat connected to: 0123456789ABCDEFG
--------- beginning of /dev/log/main
-------- beginning of /dev/log/system
** Activity (main) Create, isFirst = true **
java.lang.RuntimeException: You must call Parse.initialize(context, oauthKey, oauthSecret) before using the Parse library.
    at com.parse.ParseUser.checkApplicationContext(ParseUser.java:1162)
    at com.parse.ParseUser.getCurrentUser(ParseUser.java:946)
    at com.parse.ParseUser.getCurrentSessionToken(ParseUser.java:1004)
    at com.parse.ParseAnalytics.createCommand(ParseAnalytics.java:229)
    at com.parse.ParseAnalytics.trackAppOpenedInBackground(ParseAnalytics.java:49)
    at com.parse.ParseAnalytics.trackAppOpened(ParseAnalytics.java:78)
    at anywheresoftware.b4a.objects.ParseObjectWrapper$ParseWrapper.TrackOpening(ParseObjectWrapper.java:448)
    at b4a.example.parse.main._activity_create(main.java:342)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at b4a.example.parse.main.afterFirstLayout(main.java:98)
    at b4a.example.parse.main.access$100(main.java:16)
    at b4a.example.parse.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5297)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)

What do I do?
 

derez

Expert
Licensed User
Longtime User
You have to create the userID and key in parse site, then make the res.xml file as described in the readme file in the demo application.
 
Upvote 0
Top