-
-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert APNs tokens to Firebase registration tokens #664
Comments
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let me know if that works for you by leaving a 👍. Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions! |
I already have an implementation for this method, I could add it to the package if it is still needed/desired |
That would be great. |
That would help Here is my lines to get it working use GuzzleHttp\RequestOptions;
use Kreait\Firebase\Factory;
$factory = new Factory();
$factory = $factory->withServiceAccount(config('firebase.projects.app.credentials'));
$googleApiClient = $factory->createApiClient([
'base_uri' => 'https://iid.googleapis.com',
'headers' => [
'access_token_auth' => 'true',
'User-Agent' => 'Custom UA',
],
]);
$request = [
RequestOptions::JSON => [
'application' => $appId,
'sandbox' => $sandboxMode,
'apns_tokens' => [
$apnsToken,
],
],
];
Context::merge([
'request' => $request,
]);
$response = $googleApiClient->post('/iid/v1:batchImport', $request); |
Hi, the insance id api will be deprecated at the end of this month so I think it's safe to close this issue, afaik the new api does not support converting apns tokens to firebase anymore |
Please cite your sources, all the Google docs I checked and topics indicated this API will not be deprecated |
But I don't see right now that/how it impacts Admin SDKs. For the time being I think we're safe, as far as I can see, this mainly affects Client SDKs. it seems the new concept of "Firebase Installation Identifier" is equivalent to FCM Registration Tokens, and it provides "just" a method to delete FIDs. https://firebase.google.com/docs/reference/admin/node/firebase-admin.installations.installations in the context of Admin SDKs (not this one, yet), deleting FIDs has a caveat:
So, deleting FIDs seems to be best handled on-device. |
As for the feature to convert APNS tokens to Firebase Registration IDs, this is something I cannot test, so I would have to implement it blindly. It's possible, but I would need people testing this on their projects for me. |
The Instance ID API is deprecated. If you need to access unique app installation identifiers, use the Firebase installations API. See also Firebase installations and Instance ID. |
Okay, well here is my source: https://firebase.google.com/support/faq?hl=fr#fcm-23-deprecation
At work, the endpoint works fine with the new auth |
For sure, batch import as coded in my example can be a starting point. For sure I will do my best to try new implementations |
Indeed, this SDK doesn't use static server keys, so you should be fine 💪🏻 |
Could batch import be added? By the way, is there some config to set the user agent globally? |
Describe the feature you would like to see
I just wondering if you find it fit to add batchImport method to this library. The API converts APNs tokens to Firebase tokens. I hope it will be a handy feature for iOS app developers, since the iOS devices give us APNs tokens instead of Firebase messaging tokens, which need to be converted in server side.
The API reference: https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens
The text was updated successfully, but these errors were encountered: