Skip to content
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

Can't receive messages on iOS #10

Closed
solinder opened this issue Jul 9, 2018 · 13 comments
Closed

Can't receive messages on iOS #10

solinder opened this issue Jul 9, 2018 · 13 comments

Comments

@solinder
Copy link

solinder commented Jul 9, 2018

Hello.
I have done all instructions for configuring my iOS project from your README.md.
And i push test messages from my account in your portal.infobip.com.
I use development provision profile and install app from xcode using the "run" tool.
The situation is like this:

  1. If i simply build app and install in on device it doesn't receive push notifications.
  2. I installed my app on two devices. Lets call them d1 and d2. They do not receive notifications i sent from portal.infobip.com.
  3. I installed your application "Infobip Push" from App Store https://itunes.apple.com/ru/app/infobip-push/id1117351371 on the d1.
  4. Then i log in your app "Infobip Push" on d1 using my login and password in your system.
  5. Now if i push test notification from my account in your portal.infobip.com device d1 receives it. And device d2 also receives it.
  6. Then i uninstall your app "Infobip Push" from d1. Device d2 now does not receive push notifications. But d1 still receives them.

This behavior is strange in my opinion.
Could you advice me something? Thanks.

@tjuric
Copy link
Member

tjuric commented Jul 9, 2018

Hi @solinder,
Behaviour that you described sounds strange.

Can you confirm that you configured push in Javascript as described in Initialization configuration?
If yes, please, share with us your application code on push.support@infobip.com so we can continue investigation.

BR, Tereza.

@solinder
Copy link
Author

About 'Initialization configuration' could you explain me please:

  1. This configuration shoul be done in my ionic app while doing MobileMessaging.init(), right?
  2. Where should i get value for the param 'notificationExtensionAppGroupId' for ios configuration block?
  3. Is the param 'notificationCategories' required?
  4. I could skip the param 'messageStorage' if i set 'defaultMessageStorage' to true?

@tjuric
Copy link
Member

tjuric commented Jul 10, 2018

Mobile Messaging SDK should be initialized in Cordova’s onDeviceReady function. Required params are the ones below:

onDeviceReady: function() {
    ...
    MobileMessaging.init({
            applicationCode: '<your_application_code>',
            geofencingEnabled: '<true/false>',
            android: {
                senderId: '<sender id>'
            },
            ios: {
                notificationTypes: ['alert', 'badge', 'sound']
            }
        },
        function(error) {
            console.log('Init error: ' + error);
        }
    );

    MobileMessaging.register('messageReceived', 
        function(message) {
            console.log('Message Received: ' + message.body);
        }
    );

    ...
}
  1. Configuration should be initialized after Cordova’s deviceready event with configuration options in MobileMessaging.init() function.
  2. notificationExtensionAppGroupId param is required to improve delivery rate for your app. You need to provide this parameter in app configuration if you want to use notification extension. It should be acquired like this: https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Notification-Service-Extension-for-Rich-Notifications-and-better-delivery-reporting-on-iOS-10. Here is a description for this parameter: https://github.com/infobip/mobile-messaging-cordova-plugin#enabling-notification-extension-in-ios-for-rich-content-and-reliable-delivery
  3. notificationCategories parameter is not required
  4. I could skip the param 'messageStorage' if i set 'defaultMessageStorage' to true?

Yes.

@solinder
Copy link
Author

solinder commented Jul 10, 2018

  1. Is it nesessary to create Notification Service Extension in XCode for just receiving notifications in my app?
    Or i can do it only if i want to improve delivery rate for my app in future?

This question appeares because the parameter 'notificationExtensionAppGroupId' is not presented in the list of required parameters that you mention firstly. And i want to understand is it really required for getting notifications on iOS or not.

@tjuric
Copy link
Member

tjuric commented Jul 10, 2018

It is necessary only if you want to improve delivery rate and/or support rich content inside iOS push notifications. That's the reason it wasn't mentioned there.

@solinder
Copy link
Author

I understand. Thank you.
I will now try and test my app again.

Could you explain about this Notification Service Extension.
If i would use it in future, i should once create and configure it in XCode and just add 'notificationExtensionAppGroupId' parameter when MobileMessaging.init(), and then i can freely remove platform and add platform again in my ionic project and build app?
Or i shoud create and configuring this Notification Service Extension in XCode every time after adding ios platform to ionic project before building app?

@tjuric
Copy link
Member

tjuric commented Jul 10, 2018

You're welcome @solinder. I hope that you'll manage to set up everything pretty soon. Looking forward to your positive response.

Notification Service Extension should be created once as described.
Since plugin doesn't automate Notification Service Extension implementation, configuration in XCode should be repeated after each rm/add platform and project settings applied.

May I ask on which occasions do you perform ionic platform remove ios?

@solinder
Copy link
Author

I understand.
I am interested in this topic because our company has build bash scripts for applications. We don't build every time manually from XCode, but run this bash scripts in which all commands like 'ionic cordova remove platform', 'ionic cordova add platform', 'ionic cordova build ...' and others are called.
And i'm thinking about if it is possible to use this Notification Service Extension with build scripts.

@tjuric
Copy link
Member

tjuric commented Jul 10, 2018

Well yes, you can use Extension, it's just that it might be inconvenient to set this up each time.
You might simplify this procedure if you'll need to perform it often. For example, you might save the XCode project with Extension and all manual settings in another repo and use it instead of the one that is generated by "platform add" (replacing one with another), but make sure to maintain it.

Will you inform us on your progress with setup here?

@solinder
Copy link
Author

solinder commented Jul 10, 2018

Ok, thank you. I will think about opportunities to use Extension with build scripts later.
Now i try simply to get notifications on iOS. I will inform you about how it would work. And if it wouldn't i will send you my application code as you suggest me in your first message.

@tjuric
Copy link
Member

tjuric commented Jul 10, 2018

Ok. We'd strongly advise you to use the Extension after you successfully test receiving scenario, but in the end it's up to you.

Waiting on your feedback.

@solinder
Copy link
Author

I have tested my application on iOS. It receives push notifications.
But when i was doing the same things before using your plugin version 0.8.6 behavior was strange like in my first message.
So i think that this problem gone in new version of your plugin.
Thank you.

@tjuric
Copy link
Member

tjuric commented Jul 10, 2018

Great! I’m closing the issue since your issue is solved.
Refer to our readme docs for further feature implementation or contact us on push.support@infobip.com.

BR, Tereza

@tjuric tjuric closed this as completed Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants