Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Bug with GetTags on Android
Started by nandgate Apr 04 2019 11:47 AM

2 replies to this topic
onesignal push notifications android
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

nandgate

[GLOBAL: userInfoPane.html]
nandgate
  • Enthusiast

  • 82 posts
  • Corona SDK

I've communicated all the details to OneSignal, but I thought I'd drop this here as well to see if this is impacting anyone else.

 

The TLDR is that once a GetTags() call is made the following two errors will show up in the logs:

D/OneSignal: OneSignalRestClient: Making request to: https://onesignal.com/api/v1/players/xxxxx-xxxxx-xxxxx-xxxxx/on_session
D/OneSignal: OneSignalRestClient: POST SEND JSON: {"tags":{"build_number":"1001"},"app_id":"xxxxx-xxxxx-xxxxx-xxxxx"}
V/OneSignal: OneSignalRestClient: After con.getResponseCode  to: https://onesignal.com/api/v1/players/xxxxx-xxxxx-xxxxx-xxxxx/on_session
D/OneSignal: OneSignalRestClient: Successfully finished request to: https://onesignal.com/api/v1/players/xxxxx-xxxxx-xxxxx-xxxxx/on_session
D/OneSignal: POST RECEIVED JSON: {"success":true,"id":"xxxxx-xxxxx-xxxxx-xxxxx"}
I/OneSignal: Device registered, UserId = xxxxx-xxxxx-xxxxx-xxxxx
W/System.err: com.naef.jnlua.LuaRuntimeException: attempt to call a nil value
W/System.err:     at com.naef.jnlua.LuaState.lua_pcall(Native Method)
W/System.err:     at com.naef.jnlua.LuaState.call(Unknown Source:4)
W/System.err:     at OneSignal.LuaLoader$GetTagsFunction$CoronaGetTagsHandler$1$1.executeUsing(LuaLoader.java:263)
W/System.err:     at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:195)
W/System.err:     at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:116)
W/System.err:     at com.ansca.corona.Controller.updateRuntimeState(Controller.java:343)
W/System.err:     at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:450)
W/System.err:     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
W/System.err:     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
D/OneSignal: curActivity is NOW: null

and

 

D/OneSignal: registerUser: registerForPushFired:true, locationFired: true, awlFired: true
D/OneSignal: OneSignalRestClient: Making request to: https://onesignal.com/api/v1/players/xxxxx-xxxxx-xxxxx-xxxxx/on_session
D/OneSignal: OneSignalRestClient: POST SEND JSON: {"app_id":"xxxxx-xxxxx-xxxxx-xxxxx"}
V/OneSignal: OneSignalRestClient: After con.getResponseCode  to: https://onesignal.com/api/v1/players/xxxxx-xxxxx-xxxxx-xxxxx/on_session
D/OneSignal: OneSignalRestClient: Successfully finished request to: https://onesignal.com/api/v1/players/xxxxx-xxxxx-xxxxx-xxxxx/on_session
D/OneSignal: POST RECEIVED JSON: {"success":true,"id":"xxxxx-xxxxx-xxxxx-xxxxx"}
I/OneSignal: Device registered, UserId = xxxxx-xxxxx-xxxxx-xxxxx
W/System.err: com.naef.jnlua.LuaRuntimeException: attempt to call a number value
W/System.err:     at com.naef.jnlua.LuaState.lua_pcall(Native Method)
W/System.err:     at com.naef.jnlua.LuaState.call(Unknown Source:4)
W/System.err:     at OneSignal.LuaLoader$GetTagsFunction$CoronaGetTagsHandler$1$1.executeUsing(LuaLoader.java:263)
W/System.err:     at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:195)
W/System.err:     at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:116)
W/System.err:     at com.ansca.corona.Controller.updateRuntimeState(Controller.java:343)
W/System.err:     at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:450)
W/System.err:     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
W/System.err:     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)

once either of these occur, the app will crash within one or two actions.   

 

I've been able to easily reproduce this issue with a simple native application as well as a simple lua-only application built by Corona's servers.

 

Has anyone else encountered this issue on Android?

 

 

 



[TOPIC: post.html]
#2

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,087 posts
  • Corona SDK

I have been using the rest call so I don't have this issue. If you have the userId you can retrieve the tags by issuing a get request with the Id of the player:

https://onesignal.com/api/v1/players/<idOfPlayer> 

Then the tag will be at the root of the document:

 

{
    "id": "xxxx",
    "identifier": "xxxx",
    "session_count": 992,
    "language": "es",
    "timezone": -10800,
    "game_version": "2203",
    "device_os": "6.0.1",
    "device_type": 1,
    "device_model": "SM-G903M",
    "ad_id": "xxx",
    "tags": {
        "gsUserId": "xxxx"
    },
    "last_active": 1554418720,
    "playtime": 594394,
    "amount_spent": 0,
    "created_at": 1505781269,
    "invalid_identifier": false,
    "badge_count": 0,
    "sdk": "020550",
    "test_type": null,
    "ip": "xxx",
    "external_user_id": null
}


[TOPIC: post.html]
#3

nandgate

[GLOBAL: userInfoPane.html]
nandgate
  • Enthusiast

  • 82 posts
  • Corona SDK

I think I might have to.  The Android plugin is just so broken for tags.  There's yet another crash that will happen if you try to delete a tag that doesn't exist.

 

W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'void com.onesignal.OneSignal$ChangeTagsUpdateHandler.onSuccess(org.json.JSONObject)' on a null object reference
W/System.err:     at com.onesignal.OneSignal$11.run(OneSignal.java:1508)
W/System.err:     at com.onesignal.OneSignal.sendTags(OneSignal.java:1524)
W/System.err:     at com.onesignal.OneSignal.sendTags(OneSignal.java:1450)
W/System.err:     at OneSignal.LuaLoader$SendTagsFunction.invoke(LuaLoader.java:185)
W/System.err:     at com.naef.jnlua.LuaState.lua_pcall(Native Method)
W/System.err:     at com.naef.jnlua.LuaState.call(Unknown Source)
W/System.err:     at com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:156)
W/System.err:     at network.NetworkRequest$LuaCallback$1.executeUsing(NetworkRequest.java:612)
W/System.err:     at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:195)
W/System.err:     at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:116)
W/System.err:     at com.ansca.corona.Controller.updateRuntimeState(Controller.java:343)
W/System.err:     at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:450)
W/System.err:     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
W/System.err:     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)



[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: onesignal, push notifications, android