iOS Question [SOLVED] Push notifications for the App Store version

Martin Larsen

Active Member
Licensed User
Longtime User
I am about to create the first App Store release of my app. The app uses FirebaseNotifications.

For this I have created a new explicit app identifier and a new production certificate and a new provision file as advised.

But I am in doubt of the meaning of:

I recommend using a Production SSL Certificate with a Distribution / Ad Hoc provision profile. This way you can use the same tokens during development and in production.

What are these tokens? When sending out push messages I only use the API key and the topic I wish to send.

Can I use the same API key I have used for testing or do I need to create a new Firebase project with its own API key?
 

Martin Larsen

Active Member
Licensed User
Longtime User
But I do need to add the new app identifier to the Firebase project in order for the notifications to work with the release app?

I guess I am confused about how Firebase knows which app to send to.
 
Last edited:
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
I am pretty sure I used a production certificate because I followed your guide meticulously. But is is some months ago. Can I somehow check if I used a production certificate?

The reason for my confusion is that when I created the new app identifier and checked Push notifications under Capabilities, I had to create a new certificate. I could not choose the other certificate. But the text was "Create an additional certificate to use for this App ID." so maybe it wasn't need at all?
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
Ok thanks. I will try it in debug mode.

Is the app tied together with the Firebase project via the firebase_push.p12 file?

If so, I guess it will work fine if only the provision profile is based on the same certificate that was used for creating the push store file from within the IDE. Is my understanding correct?
 
Last edited:
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
Download the new production certificate + provision profile and try it in debug mode.

I get this error: Store provision profile can only be used in Release compilation.

Make sure to create the store provision profile from the same certificate.

You mean the OS Distribution cert?

BTW, I did use a production certificate. If I look at the original App ID, I can only revoke the production certificate. There is no development certificate.
But the App ID is different because I created a new ID and package name specifically for the App Store version. Is this a problem?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
No. I assume that the app package name wasn't changed.

It was. Originally the package name was b4i.<myapp>. I did that because the examples and videos used that convention. Now it is in the reverse domain style related to the company.
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
As feared, the notifications don't work on the app from the AppStore. Probably because it has a new package name?

So do I have to start over, following the tutorial from scratch? And how do I handle the fact that notifications work fine on the Android app from Play Store (because the package name didn't change)? Do I have to start over with both apps or can I somehow join the new IOS package name to the original API KEY so I don't have to change anything for the Android app?

EDIT: I guess it must be possible to have several apps (package names) configured with the same Firebase Push project? For example, often there are light and pro versions of the same app, and I guess these use the same API KEY and tokens?

EDIT 2: Yes, it is possible to add another IOS package name to the Firebase project. I have add the new app to Firebase, uploaded the new firebase_push.p12 file created with the new package ID and certificates and downloaded the GoogleService-Info.plist. I will then create a new release app and upload it to the AppStore and see if it works. Please correct me if I am missing some steps or doing anything wrong :)
 
Last edited:
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
It worked. You can add several apps to the same Firebase project and you use the same tokens. So sending push messages with the same server keys and topics now works for all apps: The App Store version, the ad-hoc test version, and the Android app.
 
Upvote 0
Top