iOS Question Firebase notifications b4i

Tomas Petrus

Active Member
Licensed User
Longtime User
Hi everyone,
I have an issue regarding Firebase notifications for B4A that is very similar to the one described here:
https://www.b4x.com/android/forum/threads/firebase-notifications.166972/

I have a few additional questions for B4i, though.

In Firebase, each app within a project can have its own APN auth key. This means:
  • When you use APN A, it targets app A.
  • When you use APN B, it targets app B.
  • Similarly, for Firebase authentication, you can use KEYS.
    When using a KEY with push notifications to authenticate to Firebase for sending, does the app still need its own NON-WILDCARD provisioning profile with push notifications activated?
    Or can it just have its own App identifier and use a WILDCARD provisioning profile with Cloud Messaging enabled?
Sorry if my questions are basic – I just need some clarification on the logic behind this before making decisions on how to proceed.

Thanks in advance!
 

Tomas Petrus

Active Member
Licensed User
Longtime User
finishing and testing..
The wildcard belongs to the app id, not the provision profile. And yes, for push notifications the app needs an non-wildcard app id.

this seems to be incorect.. When i have wild card provisioning profile even if App identifier is non wild card and have Pushnotifications enabled the profile does not.. and therefore It doesnt work

In detail of wildcard provisioning profile is:
Enabled Capabilities: None


B4X:
GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --version --output-format xml1

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Users/administrator/Documents/UploadedProjects/<user id>/Images.xcassets

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/actool --version --output-format xml1

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -version_details

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk -x c -c /dev/null

Build description signature: 87f6ea49a6810f55d540054126189c58
Build description path: /Users/administrator/Documents/UploadedProjects/<user id>/build/XCBuildData/87f6ea49a6810f55d540054126189c58.xcbuilddata
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject.xcodeproj: error: Provisioning profile "2025wildcard" doesn't support the Push Notifications capability. (in target 'B4iProject' from project 'B4iProject')
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject.xcodeproj: error: Provisioning profile "2025wildcard" doesn't include the aps-environment entitlement. Profile qualification is using entitlement definitions that may be out of date. Connect to network to update. (in target 'B4iProject' from project 'B4iProject')
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/administrator/Documents/UploadedProjects/<user id>/cs.lproj/InfoPlist.strings (in target 'B4iProject' from project 'B4iProject')
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/administrator/Documents/UploadedProjects/<user id>/de.lproj/InfoPlist.strings (in target 'B4iProject' from project 'B4iProject')
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/administrator/Documents/UploadedProjects/<user id>/en.lproj/InfoPlist.strings (in target 'B4iProject' from project 'B4iProject')
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/administrator/Documents/UploadedProjects/<user id>/es.lproj/InfoPlist.strings (in target 'B4iProject' from project 'B4iProject')
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/administrator/Documents/UploadedProjects/<user id>/hu.lproj/InfoPlist.strings (in target 'B4iProject' from project 'B4iProject')
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/administrator/Documents/UploadedProjects/<user id>/sk.lproj/InfoPlist.strings (in target 'B4iProject' from project 'B4iProject')

Error: ** BUILD FAILED **
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
If this is correct then ...
I have 40+ same apps just diferent brands / customers

Now before notifications I have 1 provisioning profile for devel and 1 for AppStore for all apps.

Now if I understand it well I will have to have 40+ devel provisionings profiles and 40+ for AppStore

and renew them each year - or when I need to update or devel app

And also new 40+ Certificates for push notifications for each apps that have to be renewed also each year ?
What happen if notification certificates expire ? Notifications stops working or app cannot be updated until renew ?

Do I understand it correctly ?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The push notification capability does require an explicit (non-wildcard) app id, which means that you need a separate provision profile for each app.

And also new 40+ Certificates for push notifications for each apps that have to be renewed also each year ?
I'm not 100% sure about this one. You might be able to reuse the push notification certificate. Notifications stop working once it expires.

While it is annoying to create multiple keys, I don't think that it will take you more than a hour to create 40 provision profiles.
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
Thanks Erel,
I will check reusability of the push certificate.
If firebase connection is not setup by push certificate but by universal APN key. Still notifications stop working after push certificate expire ?

Renew push certificate means: Generate new certificate before expiration and then new provisioning profiles and then publish app again ?
Or just new push certificate is enough ?
 
Upvote 0
Top