One Signal push notifications on ios 14+

I just implemented the basic init call and listener for oneSignal using the Solar2D plugin for ios. No fancy API calls or anything, just simple init and listener given on their website’s documentation.

Now, this worked right away for my old iphone 6 running ios 12 but I simply can’t get my iphone x (ios 14.5) to register on the oneSignal dashboard.

Is this a thing with the new iOS or is something wrong with the plugin? I believe this is the most commonly used solution for push messages on Solar2D so I’m hoping someone can offer some guidance.

Previous we used to use app42 for push but their service seems to be broken now.

Thanks in advance

We are basically in the same boat. I have been using App42 for several years now but IOS push notifications just stopped working (Android works fine). I’ve had a ticket in with their support for almost 2 weeks now. Haven’t heard a word.

So I started looking elsewhere and kicked the tires on OneSignal. While I did get both Android (11) and IOS (14.6) devices to register and I could send tests to both via their dashboard, they did not have a way to associate a player’s user name (unique to my game) with their push token which my app needs. They have a method called setExternalUserId which would be perfect, but it is not available for Solar2D. I hit their support up and verified that was the case.

So I turned my attention to Firebase and that is where I am at the moment. While it is working fine with Android, I am getting an error/crash using the firebase plugin for IOS described here.

Funny thing, I can use www.pushtry.com and both FCM and APNS work great so I know I have my certs, .p12 and provisioning profile are set correctly. I am hoping that if I can get my Firebase/IOS issues figured out, that may have something to do with App42 not working. I will let you now if I make any progress.

App42 has been very handy for our backend needs all along and I just hope they’re not winding down. They’re actually based pretty close to our workplace and have seemingly downsized since the pandemic

I actually got my device to register after a restart so for now that’s taken care of— yet to test on android.

I’m very new to onesignal but looking at their documentation, I feel you could possibly use tags to id your users. I’m sure you thought of this but just to state the obvious in case it might help. Won’t be ideal with the huge number of entries but could work.

We will need to do something similar for one of our older apps now that APN isn’t working on app42 and I’ll post back if I can work out a cleaner way to handle user ids. Cheers

I tag my users that I send to OneSignal. Basically I connect to GameSparks (another half dead service) then register that userId in OneSignal. Then using GameSparks and the tag, I am able to send messages to users from GameSparks base on certain events. “Win a Game”. “Your turn”. ect.

I had a quick question since you seem to have it working on Android-- did you experience any duplication in push messages? Any push message sent from OneSignal via FCM to Android devices is being delivered twice on each device in our case. We’ve checked and there’s no other service included in our build that “listens” for remote notifications and we’ve unsubscribed these devices from app42 to ensure that any messages being sent are only via OneSignal.

Will really appreciate any insight you may have on this… thanks

No duplicate messages here. Here is the code I use from gamesparks end to send the message. You can probably use it from your backend since all it is is javascript.

var jsonBody = {

 app_id: "<appId>",

 filters: [
   {"field": "tag", "key": "<keyYouUsedToTagUser>", "relation": "=", "value": <valueOfTheKey>}
  ],

  contents: {en:<spanishText>, es:<englishText>},
 };

  var promise = Spark.getHttp("https://onesignal.com/api/v1/notifications").setHeaders({
  "Content-Type": "application/json;charset=utf-8",
  "Authorization": "Basic <authKeyFromOneSignal>"

}).postJson(jsonBody);

Then in lua I send this:

local OneSignal = require("plugin.OneSignal")
OneSignal.SendTag(<keyToTagUser>, <valueOfTag>)

A screenshot of what the tags look like:

Thanks a lot for sharing. It’ll of course be ideal if we can simply resolve the duplicate messages issue with out current implementation but really appreciate you sharing this. Cheers!

I never had any duplication with OneSignal, but honestly, I went another direction fairly quickly so I didn’t test it too much. The only duplication I ever had with push notifications was using App42 when I had both a development and production APN certificate installed in the App42 portal.

The direction I have taken is using the Firebase APIs along with network.request to send my push notifications directly to FCM. This way, I no longer have to rely on third parties like OneSignal or App42 to push my notifications.

I’m storing the device token and device type in a player profile collection on App42. When a player completes their turn, the app looks up their opponent’s device token in that profile collection then posts the notifications to https://fcm.googleapis.com/fcm/send and off she goes.

I still have some testing to do as there about 10 or so different push notifications in my app but so far so good. If you are interested in the FCM code, just let me know. Glad to post what I have.

Yes aways best to take things up on the lower level wherever you can- thanks for the suggestion.

It seems yours is more of a PvP case while we just send push messages with additional data to reengage and send in-app rewards etc so having the OneSignal dash and analytics is quite helpful. The duplicate notifications are frankly not that big of deal and all other features work so we can probably continue using it for now. Might try and get some assistance directly from the folks at OneSignal.

Thanks again