In my app remote notifications work fine in foreground and background. But, if app is terminated, there are no Application_RemoteNotification events.
I found old forum discussions and accepted this situation like inevitable evil.
But an application of my son's company accepts pushes, even if terminated.
Unf., my son is a web-developer and does not know details. Alone, what is known, that they use ordinary (not silent) pushes.
In iOS if an app is suspended or terminate then push notifications will be handled by system. But if you want to handle a push notification even if your app is terminated then you have to add NotificationServiceExtention. But it is not supported by B4I. Though if you know objective c and have xcode knowledge then you can add that from xcode.
Yes in xcode its easy. But the app group setup process is a bit complicated. I have done this before but every time you build a release version you need to do all those stuff again. Thats why I had to remove notification handling stuff from my project. So how you can do that is as follows,
1. You need a Mac and Local Builder
2. Build Release version.
3. Open local builder folder in you mac
4. Go to UploadedProjects > UserName
5. Open B4iproject.xcodeproj
6. Now there are lots of tutorials of NotificationServiceExtention available on internet
7. Follow those steps
8. Dont forgot to setup app group from apple developer console
When the app is not running the notification will show and your app will start if the notification is clicked.
You can use silent push notifications to cause your app to start however they are less reliable.
The purpose of NotificationServiceExtention is to customize the notification.
I tried to implement dummy NotificationServerExtention.
XCode creates three files (see XCode.zip).
To convert .m and .h was simple (hope, I did this correctly - see 2.zip).
But when I tried to add #PlistExtra : <key>NSExtension</key>..., the screen became back (Activity_Start happens and dies).
Guess, OBJC code is not important here (the same happens, if to remove inline objective-c).
I suspect that IOS tries to communicate with app using service functions and does not receive correct answer.
Unf., I did not follow any tutorial. I simply added "target" in XCode.
BTW, I was not able to reproduce your algorithm (from step 6). The wizard offered to enter "ProductName" and to change Bundle.
But if you can add NotificationServerExtention to B4I-project, we can compare original and modified variants and will find differences.
Yes after adding the target to your project you need a different provision profile for your extension. You have to create it from apple developer console and you have to turn on push notification capability and configure apn then the extension will work. That's why I told you to search for an example on the internet.
It seems that the extensions are organized separately from the project itself. Like in Windows - Exe and Dll.
So my attempt to include objc into main module was wrong.