Hello everyone,
My app uses supabase.I have deployed a push notifcation feature that works fine on android.
My problem is on IOS.I m testing the app on a iphone 6 throught test flight.
I have setup diffrent things in my developer.apple account:
A key.thsi key has been uploade in my firebase/settings/cloud messaging/ios with the key id and team id
In developer.apple I have also certificate for Apple push service.for the certificate signin request, I have created one on my pc with openssl.I don't know if it is a good idea..
Important:In my FF settings, push notification is not turned on as I don't use Firebase for auth (but supabase).
The message I have in my log while using iphone is:
"error": "[firebase_messaging/apns-token-not-set] APNS token has not been set yet. Please ensure the APNS token is available by calling `getAPNSToken()`."
My fonction I call on main.dart(works fien for android!) has:
FOR IOS ONLY:
String? apnsToken;
int maxRetries = 3;
for (int i = 0; i < maxRetries; i++) {
await logToSupabase('Tentative APNS ${i + 1}');
apnsToken = await firebaseMessaging.getAPNSToken();
if (apnsToken != null) {
await logToSupabase('APNS Token obtenu', extraData: {
'tokenPreview':
'${apnsToken.substring(0, min(10, apnsToken.length))}...'
});
break;
}
await Future.delayed(Duration(seconds: 5));
}
if (apnsToken == null) {
await logToSupabase('APNS Token non obtenu après plusieurs tentatives');
/*return 'erreur APNS';*/
}
}
then for all system:
fcmToken = await firebaseMessaging.getToken(vapidKey: vapidKey);
so getAPNSToken return null always.
I have also try to send a message push from the firebase interface (messaging) on IOS phone but didn't receive anything.I guess the problem comes from the settings in firebase/apple. Like they can't comuunicate but I am really lost on that.
If someone is willing to help me, I will really appreciate (I’m even willing to pay a small amount because it’s really blocking me.)
thank you in advance