janderkan Well-Known Member Licensed User Longtime User Apr 15, 2018 #1 My App uses FCM and MQTT. The App works fine in both debug and release mode and I have created a testflight with no problems. The problem only shows in release mode and only in one case: My phone is locked and screen off. After a while when the App has been killed, I receive a firebase notification. The screen turns on, i press the notification and enter password to unlock phone. Main screen of my App is visible and within less than a second the App crashes. I use iReleaseLogger, have a log statement and a try catch in every sub, but nothing in the log. Now I am stuck, I have tried to include the dSYM, but then my App will not compile. (Attached error.txt) Attachments error.txt error.txt 150.4 KB · Views: 596
My App uses FCM and MQTT. The App works fine in both debug and release mode and I have created a testflight with no problems. The problem only shows in release mode and only in one case: My phone is locked and screen off. After a while when the App has been killed, I receive a firebase notification. The screen turns on, i press the notification and enter password to unlock phone. Main screen of my App is visible and within less than a second the App crashes. I use iReleaseLogger, have a log statement and a try catch in every sub, but nothing in the log. Now I am stuck, I have tried to include the dSYM, but then my App will not compile. (Attached error.txt)
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2018 #2 dSYM will not help here. Are you using a local Mac? Upvote 0
janderkan Well-Known Member Licensed User Longtime User Apr 16, 2018 #3 Erel said: dSYM will not help here. Are you using a local Mac? Click to expand... No I am using the hosted builder. I have some of my subs compiled in a lib, will try catch and log work with iReleaselogger? Should I try to include the subs in my project? If I receive the notification and wait until it disappears, then I can open my App with no problem. So it looks as the problem shows, when data is transfered to Application_RemoteNotification Is it possible that the notification itself contains something that give this problem? Last update: I test 2 devices, iPhone6 and iPhone7 1. I doubleclick the button and swipe up to remove the App. Receives FCM. Open the App and everything works fine. 2. I close the phone with 1 tap on power button and wait 3 minutes. Receives FCM. Open the App and it crashes, no error and nothing in the iReleaselogger. This is consistent. Last edited: Apr 16, 2018 Upvote 0
Erel said: dSYM will not help here. Are you using a local Mac? Click to expand... No I am using the hosted builder. I have some of my subs compiled in a lib, will try catch and log work with iReleaselogger? Should I try to include the subs in my project? If I receive the notification and wait until it disappears, then I can open my App with no problem. So it looks as the problem shows, when data is transfered to Application_RemoteNotification Is it possible that the notification itself contains something that give this problem? Last update: I test 2 devices, iPhone6 and iPhone7 1. I doubleclick the button and swipe up to remove the App. Receives FCM. Open the App and everything works fine. 2. I close the phone with 1 tap on power button and wait 3 minutes. Receives FCM. Open the App and it crashes, no error and nothing in the iReleaselogger. This is consistent.
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2018 #4 What happens if you comment the code in Application_RemoteNotification? Upvote 0
janderkan Well-Known Member Licensed User Longtime User Apr 16, 2018 #5 Erel said: What happens if you comment the code in Application_RemoteNotification? Click to expand... Exactly the same, this is the only code: Code: Copy Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler) Log($"Message arrived: ${Message}"$) CompletionHandler.Complete End Sub There are no data in the notification. Code: Copy { "notification": { "sound": "a1.wav", "alert": "true", "badge": 0, "title": "Light test", "body": "Slukket" }, "collapse_key": "dti", "to": "\/topics\/ios_25031-10000-5C_CF_7F_21_FD_66-0", "priority": 10, "data": { } } Upvote 0
Erel said: What happens if you comment the code in Application_RemoteNotification? Click to expand... Exactly the same, this is the only code: Code: Copy Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler) Log($"Message arrived: ${Message}"$) CompletionHandler.Complete End Sub There are no data in the notification. Code: Copy { "notification": { "sound": "a1.wav", "alert": "true", "badge": 0, "title": "Light test", "body": "Slukket" }, "collapse_key": "dti", "to": "\/topics\/ios_25031-10000-5C_CF_7F_21_FD_66-0", "priority": 10, "data": { } }
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2018 #6 I recommend you to start with a new project with only the push feature and test it (https://www.b4x.com/android/forum/t...ions-push-messages-server-not-required.68645/). Upvote 0
I recommend you to start with a new project with only the push feature and test it (https://www.b4x.com/android/forum/t...ions-push-messages-server-not-required.68645/).
janderkan Well-Known Member Licensed User Longtime User Apr 16, 2018 #7 Now I have started a new project, only with push notification. Exactly the same result This is the complete code: Code: Copy Sub Process_Globals Public App As Application Public NavControl As NavigationController Private analytics As FirebaseAnalytics Public fm As FirebaseMessaging Private Page As Page Dim rl As ReleaseLogger 'Remember to remove !! (uses iNetwork) End Sub Private Sub Application_Start (Nav As NavigationController) ' SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed. ' App.IdleTimerDisabled=True rl.Initialize("192.168.1.8", 54323) NavControl = Nav Page.Initialize("Main") Page.RootPanel.LoadLayout("1") Page.Title = "main_title" NavControl.ShowPage(Page) 'Firebase analytics.Initialize App.RegisterUserNotifications(True, True, True) App.RegisterForRemoteNotifications fm.Initialize("fm") Log("App Start") End Sub private Sub Application_Active fm.FCMConnect 'should be called from Application_Active Log("App Active") End Sub Private Sub Application_Background fm.FCMDisconnect 'should be called from Application_Background Log("App Background") End Sub private Sub Application_PushToken (Success As Boolean, Token() As Byte) Log("Pushtoken: " & Success) End Sub Private Sub fm_FCMConnected 'here we can subscribe and unsubscribe from topics fm.SubscribeToTopic("ios_25031") 'add ios_ prefix to all topics Log("FCMConnected") End Sub Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler) Log($"Message arrived: ${Message}"$) CompletionHandler.Complete End Sub Upvote 0
Now I have started a new project, only with push notification. Exactly the same result This is the complete code: Code: Copy Sub Process_Globals Public App As Application Public NavControl As NavigationController Private analytics As FirebaseAnalytics Public fm As FirebaseMessaging Private Page As Page Dim rl As ReleaseLogger 'Remember to remove !! (uses iNetwork) End Sub Private Sub Application_Start (Nav As NavigationController) ' SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed. ' App.IdleTimerDisabled=True rl.Initialize("192.168.1.8", 54323) NavControl = Nav Page.Initialize("Main") Page.RootPanel.LoadLayout("1") Page.Title = "main_title" NavControl.ShowPage(Page) 'Firebase analytics.Initialize App.RegisterUserNotifications(True, True, True) App.RegisterForRemoteNotifications fm.Initialize("fm") Log("App Start") End Sub private Sub Application_Active fm.FCMConnect 'should be called from Application_Active Log("App Active") End Sub Private Sub Application_Background fm.FCMDisconnect 'should be called from Application_Background Log("App Background") End Sub private Sub Application_PushToken (Success As Boolean, Token() As Byte) Log("Pushtoken: " & Success) End Sub Private Sub fm_FCMConnected 'here we can subscribe and unsubscribe from topics fm.SubscribeToTopic("ios_25031") 'add ios_ prefix to all topics Log("FCMConnected") End Sub Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler) Log($"Message arrived: ${Message}"$) CompletionHandler.Complete End Sub
Erel B4X founder Staff member Licensed User Longtime User Apr 17, 2018 #8 1. Try it without iReleaseLogger. 2. If it still doesn't work then please upload the project. Upvote 0
janderkan Well-Known Member Licensed User Longtime User Apr 17, 2018 #9 Erel said: 1. Try it without iReleaseLogger. 2. If it still doesn't work then please upload the project. Click to expand... YES, removing the iReleaseLogger did the trick. Upvote 0
Erel said: 1. Try it without iReleaseLogger. 2. If it still doesn't work then please upload the project. Click to expand... YES, removing the iReleaseLogger did the trick.