I am trying to send from my iOS-Objective-C app a message using:
NSInteger iTime = [NSDate timeIntervalSinceReferenceDate];
NSString *strID = [NSString stringWithFormat:@"%@%ld", setting.uid, (long)iTime];
NSDictionary *msg = @{@"title": @"My iOS-APP",
@"text": @"Message from the app"};
[[FIRMessaging messaging]sendMessage:msg to:setting.uid withMessageID:strID timeToLive:240];
My app connect correctly to FCM in the AppDelegate. But when sending the message above, after a couple of minutes I get the following error:
Unable to connect to FCM. Error Domain=com.google.fcm Code=2001 "(null)"
Searching in the last days I have found a lot of suggesting, but even applying them, I don't success in sending the message. Hopefully someone out there SO had the same problem and found the solution.
The FCM JavaScript API lets you receive notification messages in web apps running in these browsers: Chrome: 50+ Firefox: 44+ Opera Mobile: 37+
Food contact materials and articles (FCMs) destined for certain markets are required to be tested by designated (approved) laboratories and/or certified by Certification Bodies before they can access these important markets.
This code error 2001 is shown because, When you send the message the application is already connected to FCM. You are trying to connected again to FCM that is the reason the message. Some part of your code When you are trying send message you try to connect again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With