mirzemehdi / KMPNotifier

Kotlin Multiplatform Push Notification Library targetting android, iOS, Desktop and Web (JS and Wasm)
http://mirzemehdi.com/KMPNotifier/
Apache License 2.0
300 stars 16 forks source link

Breaks with swizzling disabled. #29

Closed anuragdalia closed 3 months ago

anuragdalia commented 4 months ago

i want to disable fcm method swizzling in ios for another library[Adjust]. but when i do that there is no way to patch kmp with custom function call/listener to listen to unnotifcenter calls . is the only way forking? basically my deeplink reading is breaking

anuragdalia commented 4 months ago

I think if the notifier object wouldn't be internal it would work.

mirzemehdi commented 4 months ago

@anuragdalia in Firebase documentation it is shown that adding below method to application method in Swift would work with swizzling disabled. Can you please check it and let me know it it works for you?

func application(_ application: UIApplication,
    didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
  Messaging.messaging().apnsToken = deviceToken;
}
anuragdalia commented 4 months ago

Yes it does. But then I'd have to not use this library. There is some handling that kmpnotifier does with a swizzled setup. If I disable swizzling I'd have to call a few of your functions directly on my own.

Nevertheless I have solved my problem some other way