We’ve actually had this issue for a while, but because we hadn’t updated our version of Corona or OneSignal for months I thought it was something that would maybe fix itself once we updated.
We updated a few weeks ago and we’re still seeing the same crashes, which I believe are somehow related to OneSignal.
The crash only happens when the app is first opened after a fresh install, and it doesn’t happen every time. However, when it does happen it always happens as a segmentation fault during the function passed to IdsAvailableCallback.
Here’s a sample of our OneSignal code:
local onesignalPushToken = nil local onesignalPlayerID = nil function IdsAvailable(playerID, pushToken) print("[M] - PLAYER\_ID:" .. playerID) onesignalPlayerID = playerID if pushToken then -- nil if user did not accept push notifications on iOS print("[M] - PUSH\_TOKEN:" .. pushToken) onesignalPushToken = pushToken else print("token is nil") end if onesignalPlayerID then if isDebug then OneSignal.SendTags({["Lang"] = langInUse,["Version Number"] = globals.versionNumber, ["tester"] = "true"}) else OneSignal.SendTags({["Lang"] = langInUse,["Version Number"] = globals.versionNumber }) end end end OneSignal.Init(key, googleProjectNumber, DidReceiveRemoteNotification) OneSignal.IdsAvailableCallback(IdsAvailable)
Is there anything in there which appears to be wrong? Annoyingly I can’t actually get it to happen right now, even though it happened a bunch of times this afternoon, otherwise I would attach a log.
I’m not 100% sure if it happens on the version that is downloaded from the store, is it possible that there is a difference in how OneSignal receives push data in apps signed with an adhoc profile and ones signed with an app store profile?