Hi,
Is it possible to add a second iOS application to an existing OneSignal project. I have 2 applications and I have created two OneSignal projet but when I send a notification to a user who belong to the second application, I get this error "All included players are not subscribed". I want to merge these two applications to have 1 big database of pushToken (playerID).
@Ptidou Just to confirm. You have 2 different iOS apps with 2 different bundle ids and a different OneSignal app_id for each?
If this is the case how are you sending notifications? With our postNotification SDK method or with our REST API? The postNotification only works to send notifications to other users on the same OneSignal app_id. You will to use the REST API with the correct app_id set that the target include_player_ids are on to send a notification.
@Ptidou We are adding support allow overriding the app_id on our postNotification in our 2.5.0.
Please let us know if you need more information on the above.
So, to be clear, if I have 2 iOS apps with 2 different ids and 2 android apps, I can sent from whomever I want (from this apps) to other apps? How exactly it can be done?
like that in swift?
OneSignal.postNotification(["contents": ["en": "Test Message"], "app_id": ["my_one_signal_app_id"]])
or like that in android?
try {
OneSignal.postNotification(new JSONObject("{'contents': {'en':'Test Message'}, 'app_id': ['" + my_one_signal_app_id + "']}"), null);
} catch (JSONException e) {
e.printStackTrace();
}
I just so desperate to figure out, how to do it and if it is possible, can you please say how? Would really appreciate your help)
Hello, I Have exactly the same issue, is someone found out a solution?
Thanks
any solution for this ?
I am not sure why exactly you would want to do such a thing on the client, but it is possible. I would recommend implementing the two apps separately and sending the notifications in question from your backend using the REST API.
You can send push notifications using the postNotification() method to any app as long as you supply both the user ID (AKA playerID) and the app ID.
Does anybody have an example call to onesignal PostNotification that includes appid? One Signal documentation has the following example that does not include appid.
OneSignal.postNotification(["contents": ["en": "Test Message"], "include_player_ids": ["3009e210-3166-11e5-bc1b-db44eb02b120"]])
Most helpful comment
@Ptidou We are adding support allow overriding the
app_idon ourpostNotificationin our 2.5.0.Please let us know if you need more information on the above.