mirzemehdi / KMPNotifier

Kotlin Multiplatform Push Notification Library targetting android, iOS and Desktop
http://mirzemehdi.com/KMPNotifier/
Apache License 2.0
200 stars 10 forks source link

Error when I try to get a token on iOS. #43

Closed tmdgh1592 closed 6 days ago

tmdgh1592 commented 1 week ago

It is a Compose Multiplatform environment and is using kotlin 2.0.0. When trying to get a token on iOS, the following bug occurs:

[FirebaseCore][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI).

Firebase Messaging has already been added as an additional xcode dependency. I wonder what the cause is.

mirzemehdi commented 1 week ago

@tmdgh1592 you probably missed ios setup part

https://github.com/mirzemehdi/KMPNotifier?tab=readme-ov-file#ios-setup

in ios application you need this FirebaseApp.configure()

image
tmdgh1592 commented 1 week ago

@mirzemehdi

Thanks for your help 😊 And in the case of iOS, p8 must be registered in Firebase for apnstoken to be issued properly, right?

mirzemehdi commented 6 days ago

yes @tmdgh1592

tmdgh1592 commented 6 days ago

@mirzemehdi thank you i will try!