Cannot subscribe to topic: iosuser with token: (null)


#1

Hello I’m trying to subscribe to topics in ios.I’m getting this “subscribe to topic: all-ios” but at the same time logs are showing “Cannot subscribe to topic: all-ios with token: (null)” .I can get token id successfully, and can receive push messages with that token id .But I cant get push messages if I try to send to topics.Any help is appreciated ;

2018-05-18 11:11:26.344954+0300 myapp[1672:632409] PushPlugin.register: clear badge is set to 1
2018-05-18 11:11:26.345053+0300 myapp[1672:632409] PushPlugin.register: better button setup
2018-05-18 11:11:26.345896+0300 myapp[1672:632409] FCM Sender ID (my senderid)
2018-05-18 11:11:26.345959+0300 myapp[1672:632409] Using FCM Notification
2018-05-18 11:11:26.411675+0300 myapp[1672:632313] FCM Registration Token: hMWSobDYKTA:APA91bGAlKF0_bgkGTIIbn0WYRppKpIDcgkRxq1ZBwoT0tCNuFKm8uOFJ2eKrkmV1iNereOsbTyj46nZtlput5NM-XBt__57bjgcbS4MH-EL9d-KM1r_U9KeAZlHbrxnMzOwhzKm9EJq
2018-05-18 11:11:26.411983+0300 myapp[1672:632313] subscribe to topic: all-ios
2018-05-18 11:11:26.421738+0300 myapp[1672:632424] 4.13.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; (FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2018-05-18 11:11:26.426396+0300 myapp[1672:632424] 4.13.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you’d prefer to manually integrate Firebase Messaging, add “FirebaseAppDelegateProxyEnabled” to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2018-05-18 11:11:26.427718+0300 myapp[1672:632313] Push Plugin register success: <d78476d1 353694bb 0bf4e3ab 22625c7a f4c4e446 21347f9c 278512d1 832a1793>
2018-05-18 11:11:26.430763+0300 myapp[1672:632424] 4.13.0 - [Firebase/Messaging][I-FCM002010] Cannot subscribe to topic: all-ios with token: (null)
2018-05-18 11:11:26.454766+0300 myapp[1672:632414] 4.13.0 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40200000 started
2018-05-18 11:11:26.455345+0300 myapp[1672:632414] 4.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2018-05-18 11:11:26.504036+0300 myapp[1672:632313] CDVWKWebViewEngine: handleStopScroll
2018-05-18 11:12:27.287052+0300 myapp[1672:632414] Task <9AF9FCB2-C7C9-4290-A859-A23D8C6941D5>.<1> finished with error - code: -1001
2018-05-18 11:12:27.287104+0300 myapp[1672:632313] <Firebase/Network/ERROR> Encounter network error. Code, error: -1001, Error Domain=NSURLErrorDomain Code=-1001 “The request timed out.” UserInfo={NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2103, NSLocalizedDescription=The request timed out.}
2018-05-18 11:12:27.288594+0300 myapp[1672:632752] Task <9AF9FCB2-C7C9-4290-A859-A23D8C6941D5>.<1> HTTP load failed (error code: -999 [1:89])
2018-05-18 11:12:27.292915+0300 myapp[1672:632749] 4.13.0 - [Firebase/Core][I-NET901017] <Firebase/Network/ERROR> Encounter network error. Code, error: -1001, Error Domain=NSURLErrorDomain Code=-1001 “The request timed out.” UserInfo={NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2103, NSLocalizedDescription=The request timed out.}
2018-05-18 11:12:27.294855+0300 myapp[1672:632752] 4.13.0 - [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1001 “The request timed out.” UserInfo={NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorFailingURLKey=https://play.googleapis.com/log, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2103, NSLocalizedDescription=The request timed out.}, with Status Code: 0

and my code to register push is ;

pushSetup() {
const options: PushOptions = {
android: {
senderID: “400528480580”,
sound: true,
topics: [“all-android”],
icon: “ic_stat_iconpush”
},
ios: {
alert: “true”,
badge: true,
clearBadge: “true”,
sound: “false”,
topics: [“all-ios”]
},
windows: {},
browser: { pushServiceURL: “http://push.api.phonegap.com/v1/push” }
};
const pushObject: PushObject = this.push.init(options);
pushObject.on(“notification”).subscribe((notification: any) => {
alert(notification.title + ": " + notification.message);
});

pushObject.on("registration").subscribe((data: any) => {
  this.userData.pushtokenSave(data.registrationId);
  this.pushKaydet(data.registrationId);
});

pushObject
  .on("error")
  .subscribe(error => console.error("Error with Push plugin", error));

}