How to get Airship device token for iOS and gcm_registration_id for Android with Flutter? - flutter

I need to get Airship device token for iOS and gcm_registration_id for Android with Flutter. I can see the device token in the console (from AirshipKit I suppose) when I start the app as well as in my Airship project. But I need to get the device token in my Flutter code as it should be used there and in my Webview.
I tried to get the device token with Firebase Messaging but it returns another token, not the one from Airship.
UPDATE:
For iOS I found a solution with FirebaseMessaging
var iosToken = await FirebaseMessaging.instance.getAPNSToken();

Related

Flutter ios app not getting firebase notifications

I have an application that I made with Flutter. Firebase test flight notifications are coming, but when I download from app store, firebase does not appear. does anyone know the solution

Android Device Verification not working in Flutter

I am trying to do get OTP without Verifying you are not a robot screen using firebase in a flutter.
I added the SHA-256 key in firebase and enabled the Android Device Verification in console developer google. But still after entering the phone number for OTP that Verifying you are not a robot screen was showing and redirecting to the app. Did I miss something or it will take time to activate Android Device Verification.
Make sure your app is Registered via SafetyNet at:
Firebase Console > Project Settings > App Check > Your app
Secondly, try to test it on a real device. If you are testing phone authentication on an emulator then reCAPTCHA screen will be still shown but for real devices it won’t be shown anymore as stated in the official documentation.
Addition: It will always be shown in rooted devices.
Edit: If this is happening only to your playstore downloaded application, then you probably didn't add your playstore signing SHA1 and SHA256 to your firebase.
Go to your playstore account, app signing under integrity and copy these keys and add them to your firebase project.

iOS app seems to register as Android device using Bluemix Push Cordova plugin

I am trying to run the sample for bluemix push cordova app from here:
I am able to install the sample on the iOS device and when I click the register button, getting the following response:
{"createdTime":"2016-08-23T10:53:26Z","lastUpdatedTime":"2016-08-23T10:53:26Z","createdMode":"API","deviceId":"xxxxxx-xxxx-xxxxxx","userId":"anonymous","token":"xxxx-xxxxx-xxxxx","platform":"A","href":"https://xxxxxx.ng.bluemix.net/imfpush/v1/apps/xxxxxx/devices/xxxxxx"}
In the response I can see that
"platform":"A"
which might be suggesting that the device is registering itself as Android device.
When i tried to push a test message to the app from Bluemix console to iOS devices, it says "No Devices Found". That not the case for Android. I am able to receive the push to Android device.
'A' refers to an iOS device (tag being Apple) rather than a Google Android device ('G'). This can be seen on the REST API by selecting the 'Model' view rather than the 'Model Schema' view.
platform (string, optional):
The device platform. 'A' refers to Apple(iOS) devices and 'G' refers to Google(Android) devices. = ['A', 'G']
string
Enum: "A", "G"
Regarding the failure to receive push notifications on iOS I would make certain that your APNs certificate is valid and properly configured. If a push is attempted by Bluemix and APNs responds that the device token is invalid due to a certificate issue then it is pruned from the device list to prevent further failed attempts which may be why you are seeing the 'No Devices Found' error.
If everything looks good with your certificate please let us know your Push Service GUID (found on the Mobile Options button in your Push Dashboard's configure page) so we can investigate further.

register device token manually with Firebase Notifications

I would like to integrate my existing ionic ios app with the new firebase notification service. But i could not find any documentation about registering a device token manually with the rest api or web api.
Am i missing any new feature? Or is this not possible with the current libraries?
Firebase Notifications at launch just supports Android and iOS.
For now, you can implement FCM directly for the web, see the documentation for FCM, which will allow pushing messages via the API.

Apple APNS Device Token

We have table where Apple Device tokens are stored. This tables are different for testing and and for live application. I want to update this database manually with my iPhone device token for testing purpose.
Is there anyway I can read the device token from my iPhone.
Note: I do not hava MAC machine.
There's a tutorial here of how to get the device token, however it requires that your test application be added some code for you to run.
Tutorial link
If in case you have the code, try putting a log for the device token in the
didRegisterForRemoteNotificationsWithDeviceToken and then check the log in your phone using a console app.