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

ARTPush didRegisterForRemoteNotificationsWithDeviceToken error #611

Closed
itolisto opened this issue Jun 7, 2017 · 6 comments
Closed

ARTPush didRegisterForRemoteNotificationsWithDeviceToken error #611

itolisto opened this issue Jun 7, 2017 · 6 comments
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@itolisto
Copy link

itolisto commented Jun 7, 2017

Hi,

I'm getting an error when calling

[ARTPush didRegisterForRemoteNotificationsWithDeviceToken:deviceToken realtime:ably];

screen shot 2017-06-06 at 22 14 13

My podfile:

platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'

# Used when using Swift libraries in a Objective-C project
use_frameworks!
# ignore all warnings from all pods
inhibit_all_warnings!

target 'Conversa' do
    pod 'Ably', :git => 'https://github.com/ably/ably-ios.git', :branch => 'push'
end

But if I use the branch 'push-spec-activationstatemachine' when I call the method

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    ARTRealtime *ably = [[CustomAblyRealtime sharedInstance] getAblyRealtime];
    if (ably) {
        [ARTPush didRegisterForRemoteNotificationsWithDeviceToken:deviceToken rest:ably.rest];
    }
}

Nothing seems to happen.

@mattheworiordan mattheworiordan added the bug Something isn't working. It's clear that this does need to be fixed. label Jun 7, 2017
@ricardopereira
Copy link
Contributor

@itolisto Could you test the push-spec-activationstatemachine branch and see if it works please?

pod 'Ably', :git => 'https://github.com/ably/ably-ios.git', :branch => 'push-spec-activationstatemachine'

@tcard
Copy link
Contributor

tcard commented Jun 7, 2017

@ricardopereira Is there anything blocking merging that with push?

@ricardopereira
Copy link
Contributor

@tcard No, it's good.

@itolisto
Copy link
Author

itolisto commented Jun 7, 2017

@ricardopereira Branch push-spec-activationstatemachine is working. Just have a question, when [ARTPush didRegisterForRemoteNotificationsWithDeviceToken:deviceToken rest:ably.rest] is called is has to print to console the device token right? But I can't see the "ARTPush: device token received" message in the logs. So I don't know if the method is actually sending the token.

And I'm still not able to receive push notifications.

@tcard
Copy link
Contributor

tcard commented Jun 7, 2017

@itolisto Does it work if you print the deviceToken yourself? If not, there's something wrong about your push setup, since that part doesn't depend on Ably. Did you follow through Apple's documentation?

@itolisto
Copy link
Author

itolisto commented Jun 7, 2017

@tcard Yes, I'm receiving the deviceToken that's precisely why I don't understand why push notifications aren't working.

As I mentioned when I submitted the issue (and if you look closely to the image attached) when I use the push branch the deviceToken is printed in console and when the didRegisterForRemoteNotificationsWithDeviceToken method is called the app crashes. On the other hand, if I use the push-spec-activationstatemachine branch, the token is not printed in console but the app doesn't crash.

Any ideas?

@tcard tcard closed this as completed Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

No branches or pull requests

4 participants