QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
397 stars 358 forks source link

Could not create subscription with Bundle_identifier - IOS #1102

Closed williamtran1988 closed 5 years ago

williamtran1988 commented 5 years ago

Hi All,

I am working on iOS sdk. Framework version 2.8.0.1 Do you know any way to create a subscription with bundle_identifier? I would like to support multi push notification certificate. I am using this

QBMSubscription *subscription = [QBMSubscription subscription]; subscription.notificationChannel = QBMNotificationChannelAPNS; subscription.deviceUDID = deviceUDID; subscription.deviceToken = deviceTokenData;

[QBRequest createSubscription:subscription successBlock:^(QBResponse *response, NSArray *objects) {

} errorBlock:^(QBResponse *response) {

}];

But i don't see anywhere to define bundle_identifier.

Many thanks, Thuong Tran.

sshaforenkoqb commented 5 years ago

Hi, there is no ability in iOS SDK to define this parameter. If you want you can use API for this, here is the link to documentation https://quickblox.com/developers/Messages#Create_subscription_.28subscribes.29

williamtran1988 commented 5 years ago

Hi @sshaforenkoqb

Can I use QBRequest to make this kind of request? Could you please show me how to do that?

Thanks

sshaforenkoqb commented 5 years ago

Do you want to pass bundle identifier different from your application? If no you don't need to do this manually, sdk takes this param from your application.

williamtran1988 commented 5 years ago

But the first certificate will be used as default, that's why my application build according to seconds cert will not work. It means that sdk will not takes automatically.

williamtran1988 commented 5 years ago

Do you have any ideas?

sshaforenkoqb commented 5 years ago

SDK is a part of your application, it will take bundle id of your application and send it to the qb backend. Your APNS certificate located at the server side. When backend will send notification it will use a certificate that corresponds to bundle id in the subscription entity(bundle id of your application that was sent previously).

williamtran1988 commented 5 years ago

On Quickblox instruction: Please make sure you keep the certificates up to date. We won't be able to send the APNS messages for you once certificates expire. If you have more than 1 push certificate for the same channel and environment and your push notifications subscriptions do not have 'bundle_identifier' value set - then the 1st uploaded certificate will be used.

So when i tried to send a push message, at first CERT i can see the log: 400/BadDeviceToken

So i think SDK did not take bundle identifier by itself.

sshaforenkoqb commented 5 years ago

Here is a log from sample-push-notifications sample: parameters: { device = { platform = ios; udid = "57B9D830-90AE-4BD6-9484-7FBA896420BC"; }; "notification_channels" = apns; "push_token" = { "bundle_identifier" = "com.quickblox.supersample"; "client_identification_sequence" = 2dde940d87cde14e470b35a5db8eadf8f13a8730b6e03f2ad40e5de6b378e4f1; environment = development; }; }

As you can see bundle identifier is there.

williamtran1988 commented 5 years ago

I have check subscriptions on quickblox CMS. the bundle_identifier is empty for my device. It could be a problem on version 2.8.0.1?

sshaforenkoqb commented 5 years ago

Maybe, this log is from version 2.17.1

williamtran1988 commented 5 years ago

Anyway, do you know how to make a QBREquest on Objective C? I would like to add it instead of using createSubscription by SDK. Because i could not upgrade to latest version at the moment.

ghost commented 5 years ago

Hello, dear @williamtran1988

Take our apologies for the delay. Could you try to make it in 2.17.1 version? There you will have the possibility to proceed with your request.

If this solution is suitable for you, please, confirm it. Also, i already closed the ticket https://github.com/QuickBlox/quickblox-ios-sdk/issues/1103 as a duplicate.

ghost commented 5 years ago

Dear @williamtran1988

The status of the ticket changed to "Closed" due to the absence of the reply from you. If you have any additional questions, please let us know.