These are chat archives for Catapush/support

19th
Feb 2016
andreydorokhin
@andreydorokhin
Feb 19 2016 09:12
Hello guys, who can help me (iOS)?
Chiarotto Alessandro
@chiarotto
Feb 19 2016 09:22
hi @andreydorokhin
andreydorokhin
@andreydorokhin
Feb 19 2016 09:28
Why I got notification only when app became active, when app in background notifications does not appear in the notification bar, no vibro, no sound, no badge on the app's icon, only when app became active again the alert appear with text "catapush connect" and then second alert with notification json?
Chiarotto Alessandro
@chiarotto
Feb 19 2016 09:31
The app is example app in github or you are speaking about you app?
your
andreydorokhin
@andreydorokhin
Feb 19 2016 09:34
Yes, my app
Chiarotto Alessandro
@chiarotto
Feb 19 2016 09:37
ok,when the app is active you don't get push noitification badga, if the app is active Catapush connect to the server and get the messages.
Now if you don't get push notification when the app is in background I will suggest that your certifcate, bundle id of the app and provisioning profile are set correctly.
I will suggest to check your certificate, bundle it and provisioning profile.
Have you already uploaded the .p12 file on your catapush account?
andreydorokhin
@andreydorokhin
Feb 19 2016 09:41
You need that I upload my certificate on catapush again?
Chiarotto Alessandro
@chiarotto
Feb 19 2016 09:43
If you have already upload the p12 is ok, You don't need to uploaded again.
andreydorokhin
@andreydorokhin
Feb 19 2016 09:43
My certificate was uploaded
Chiarotto Alessandro
@chiarotto
Feb 19 2016 09:44
Another check you can do, in order to try to find the problem:
login to catapush and check if device token is associated to your user.
This token is used to identify the recipient of a push notification.
andreydorokhin
@andreydorokhin
Feb 19 2016 10:01
No I did not find any user with my device token. How I can add user with my device token?
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:06
Catapush library exposes the following method to send device token:
  • (void)application:(UIApplication )application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken {
    [Catapush registerForRemoteNotificationsWithDeviceToken:deviceToken];
    }
The app delegate method (void)application:(UIApplication )application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken is called after the user accept to enable push notification of the app.
andreydorokhin
@andreydorokhin
Feb 19 2016 10:08
This method is in my code
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:09
An [Catapush registerForRemoteNotificationsWithDeviceToken:deviceToken]; is called?
andreydorokhin
@andreydorokhin
Feb 19 2016 10:14
yes. called
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:19
and now if you check on catapush dashboard can you see the device token?
andreydorokhin
@andreydorokhin
Feb 19 2016 10:27
Now I find my user with device token of my device but notifications do not come in background still
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:28
ok good, we made one step :-)
andreydorokhin
@andreydorokhin
Feb 19 2016 10:29
but now notifications do not come and when app active
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:30
now if the device token is associated to the user and you receive message when the app is active and you don't receive notification when the app is in background
then you should check it the capabilites of you app is correclty configured
and also check certficate and provisioning profile associated to the bundle id of your app
then:
1) capabilites in xcoce
2) push certifcate, provisioning profile and bundle id, all these 3 element are tight together
andreydorokhin
@andreydorokhin
Feb 19 2016 10:34
Now no longer notification appear when the application is active
Now I run app, got alert "catapush connect", send notification but now do not got notification and when app is active
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:49
When the app is active do you receive message (no push notification), just the message?
andreydorokhin
@andreydorokhin
Feb 19 2016 10:52
yes, now when app is active I begin receive just alert "catapush connect"
Chiarotto Alessandro
@chiarotto
Feb 19 2016 10:55
and you if send a message from the dashboard do you receive the message from you app?
andreydorokhin
@andreydorokhin
Feb 19 2016 11:01
Now. I got message from dashboard.
But I I stopped receiving messages from my server
Chiarotto Alessandro
@chiarotto
Feb 19 2016 11:04
now you can try againg to send message from catapush dashboard when the app is in background
a see if a notification badge is displayed
andreydorokhin
@andreydorokhin
Feb 19 2016 11:07
notification receive from catapush's dashboard but badge absent and I stopped receiving messages from my server
Chiarotto Alessandro
@chiarotto
Feb 19 2016 11:11
With this line you should also enable badge: [application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
Insead I cannot help you on communication problem with your server.
andreydorokhin
@andreydorokhin
Feb 19 2016 11:15

I must remove this code
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[application registerForRemoteNotifications];

}else{
    #if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
    [application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
    #endif
}

application.applicationIconBadgeNumber = 0;

and add just
[application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

?

Chiarotto Alessandro
@chiarotto
Feb 19 2016 11:19
it is right your code
andreydorokhin
@andreydorokhin
Feb 19 2016 11:22
Now notification receive good but budge is absent still
Davide Marrone
@davidemarrone
Feb 19 2016 11:22
you have to set the value for the badge from the API
andreydorokhin
@andreydorokhin
Feb 19 2016 11:23
from my server?
Davide Marrone
@davidemarrone
Feb 19 2016 11:23
is not yet automatically implemented in out backend
yes from your server
andreydorokhin
@andreydorokhin
Feb 19 2016 11:25
Thanks for support.
andreydorokhin
@andreydorokhin
Feb 19 2016 14:42
Did you change something? I do not get notification when app is in background again.
Davide Marrone
@davidemarrone
Feb 19 2016 14:46
no we haven’t changed anything
andreydorokhin
@andreydorokhin
Feb 19 2016 14:47
Now again notification come when app is active only
Davide Marrone
@davidemarrone
Feb 19 2016 14:48
could you give me the appid?
and the customer email ?
andreydorokhin
@andreydorokhin
Feb 19 2016 14:51
email: d2@d2.dd
appid: riggoh.com.Riggoh
Davide Marrone
@davidemarrone
Feb 19 2016 14:54
if you look on the dashboard for the user d2@d2.dd the token is not present
you have to register the token
and the token can be associated to only one user
andreydorokhin
@andreydorokhin
Feb 19 2016 15:03
why missing user's token?
Token was there and notifications come normal but now token missing
how to add device's token to user?
Davide Marrone
@davidemarrone
Feb 19 2016 15:07
maybe you have logged with another device with the same username?
Chiarotto Alessandro
@chiarotto
Feb 19 2016 15:09
@andreydorokhin Hi
I try to describe how the association username/device token works
ok?
1) [Catapush registerForRemoteNotificationsWithDeviceToken:deviceToken]; the device token is store in catapushlib
andreydorokhin
@andreydorokhin
Feb 19 2016 15:14
now again works normal. Please, say me if you change something, my app using your catapush
Chiarotto Alessandro
@chiarotto
Feb 19 2016 15:15
2) when you call [Catapush startWithIdentifier:username andPassword:password]; catapush lib send to the catapush server the the device token associated with the user identified by 'username'
We are not modifing your app
Davide Marrone
@davidemarrone
Feb 19 2016 15:17
we are not changing anything !
andreydorokhin
@andreydorokhin
Feb 19 2016 15:18
not my app ))) Say me if you modifing your catapush
Davide Marrone
@davidemarrone
Feb 19 2016 15:18
we are not deploying nothing new
and we are not changing any code or db
andreydorokhin
@andreydorokhin
Feb 19 2016 15:22
I change nothing in my code too but one hour ago notifications stopped come when app was in background and in the catapush's dashboard user's token devise was missing. And now user's token devise appeared again and notifications come normal )
Davide Marrone
@davidemarrone
Feb 19 2016 15:22
as said if you log in with another user token is moved from one user to the new one
if you have two app that is using the same username they are stealing the token each other
or if you use the same token with another user the token is removed from the old one
andreydorokhin
@andreydorokhin
Feb 19 2016 15:33
user can login on another device and on the previous device will be showed alert "Error. The operation connection is failed with error: connection from another device". But when notifications stopped came in background - catapush was connected.
Davide Marrone
@davidemarrone
Feb 19 2016 15:34
if the user log in in the new device the token of that device is associated with the user
if the token was disappeared id because before was on a user, you have logged in in the same device with another user and so the new user has stoled the token to the old
andreydorokhin
@andreydorokhin
Feb 19 2016 15:38
ok. Thanks