Git Product home page Git Product logo

Comments (5)

icebeam7 avatar icebeam7 commented on June 1, 2024 1

@Hamza-Hasan-Almass you don't use the FCMToken with ApnSettings because the ApnToken and the FcmToken are different.

Check this link

The device token in APNs is a 64-byte hex string, and the Device ID in FCM is a 183-byte string, containing [a-zA-Z0-9_-] (all numbers, lowercase, and uppercase alphabets, and symbols like , _ and –).

Examples:

FCM Token: aaa12Om83EL9r57in1cJpy:APA91bFv1ydna_52WPl34jNYAFCs-_MHcgrTjjYlg2NetJRPI71111jf4449md-WsSDHcKLWS_n6mGpTGtOZZZhQQQO7NiI65LZMmxqpFUbAivn_YRYR-cIceQH4AhFmg0muUGdlAQYt

APNs Token: 2f3035b209d30980e462a0921f4853021d7ee030e200bc0000487b9008a80005

If you use FCM token with ApnSender then you'll receive BadDeviceToken. Use APNs Token with ApnSender or FCM Token with FCMSender

from net-core-push-notifications.

Hamza-Hasan-Almass avatar Hamza-Hasan-Almass commented on June 1, 2024

Hi , are you fix it this issue? Or you still get BadDeviceToken ?
because i am received the same error @andrei-m-code

thanks

from net-core-push-notifications.

andrei-m-code avatar andrei-m-code commented on June 1, 2024

Guys, I need some more details on that issue... would you possibly be able to test it with the source code of the lib and create a PR?

from net-core-push-notifications.

Hamza-Hasan-Almass avatar Hamza-Hasan-Almass commented on June 1, 2024

The problem is when i am using the fcm token from client side and send the push notification from firebase console directly it was send successfully but when i am using the same fcm which i received from the client side i got BadDeviceToken.
my code is below
var apnSettings = new ApnSettings();
apnSettings.ServerType = ApnServerType.Production;
apnSettings.AppBundleIdentifier = _notificationSettings.AppBundleIdentifier;
apnSettings.P8PrivateKey = _notificationSettings.P8PrivateKey;
apnSettings.P8PrivateKeyId = _notificationSettings.P8PrivateKeyId;
apnSettings.TeamId = _notificationSettings.TeamId;

is the P8PrivateKey => must i received from file or i can copy the file content directly between start and end and using it
@andrei-m-code

from net-core-push-notifications.

Hamza-Hasan-Almass avatar Hamza-Hasan-Almass commented on June 1, 2024

@andrei-m-code Please can you tell us how can we solve this issue?
everything i set it correctly as you mentioned in the readme file but only on the iOS device i got BadDeviceToken thanks advance

from net-core-push-notifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.