OneSignal-Xamarin-SDK icon indicating copy to clipboard operation
OneSignal-Xamarin-SDK copied to clipboard

Xamarin IOS app can't loading GUI/crashing when Service Extension added.

Open gyb001 opened this issue 3 years ago • 5 comments

How can we help?

Hello. I have a strange problem. Push notification working fine for a half year, now i would like add OneSignalNotificationServiceExtension. I read the tutorial much, check everithing twice.

What happen: -Build in release mode push testflight -Click app -IOS project / AppDelegate started (LOG) -Shared project / App started (LOG) -OneSignal.Default.Initialize run whitout exception (LOG) setAppId(id) called with appId: HideMyOnesignalId setAppId(id) finished, checking if launchOptions has been set before proceeding setAppId(id) successful and launchOptions are set, initializing OneSignal -MainPage setted with my LoadPage (LOG)

What i see: Iphone 13 testflight: App crasch before "LoadPage" is appearing (I dont have log) MacMini (M1) testflight: App icon bouncing, show small point under the icon, nothing appear.

Log first page said Entitlements problem, but i think everithing is ok. App group exist in apple developer portal. i'm able to distribute app to appstore

Any tipp? Onesignal XamarinSDK 4.3.0 Latest Xamarin, VS / Vs preview. if i unload the extension project app is runing and can receive push notification Debug mode is ok, (I cant test psuh, but app is working)

Full log: (started with force kill app) https://controlc.com/c1c768d2

Some code: https://pastebin.com/55hbMNa9

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

gyb001 avatar Dec 19 '22 22:12 gyb001

Update. Its linker problem. Whitout linking work fine. What shoud i add to additional argument? (Linkskip)

Its not help: --linkskip=MyApp.iOS --linkskip=OneSignalSDK --linkskip=OneSignalNotificationServiceExtension

gyb001 avatar Dec 20 '22 18:12 gyb001

I can use full link mode with older version.

gyb001 avatar Dec 21 '22 07:12 gyb001

Hi @gyb001 apologies for the delay. Looking at your log, it looks like this is the uncaught exception that is causing the crash:

System.Exception: Please call CachedImageRenderer.Init method in a platform specific project to use FFImageLoading!

By chance did you make other changes beyond adding the NotificationServiceExtension?

brismithers avatar Jan 09 '23 14:01 brismithers

WOW, I cant recignise this exception ín log. No I cant change anything.
If extension is loaded app crashed. If extension is unloaded app runing fine. (Latest nuget version)

gyb001 avatar Jan 09 '23 17:01 gyb001

@gyb001 that exception is happening twice in the log, once at 22:18:49.600584+0100 and once at 22:37:43.215034+0100. It might be worth checking out.

I understand what you are saying regarding the app crashing only when the extension has been loaded as part of the app. In an effort to try to isolate the problem, can you try adding a NotificationServiceExtension via the instructions here, however skip steps 5.5, 5.6, and 5.7. In other words, do not add the OneSignalSDK.Xamarin library and supporting code to the NotificationServiceExtension. If your app still crashes this points to a broader setup, or maybe a signing-type issue.

Thanks!

brismithers avatar Jan 11 '23 14:01 brismithers