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

Issue reported in iOS push tutorial #850

Closed
Srushtika opened this issue May 13, 2019 · 4 comments

Comments

@Srushtika
Copy link
Member

commented May 13, 2019

Raising this on behalf of a user who originally raised this on our support channel.

What did he do?

Tried out the push direct registration tutorial in iOS, from our tutorials site.

What did he expect to happen?

The push.subscribeDevice method was supposed to subscribe the device to push channels

What happened instead?

The device wasn't subscribed. The user says:

It seems like the method used inside ARTRest::executeRequest never inserts the base URL of ably.io before the request URL.

When the user called .push.subscribeClient() from the ARTChannel which calls the function deviceUpdateRegistration, the following logs were generated:

ERROR: PATCH /push/deviceRegistrations/0001EDAT3500GW0X476W5TVBFE: error Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSUnderlyingError=0x281e37030 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}, NSErrorFailingURLStringKey=/push/deviceRegistrations/0001EDAT3500GW0X476W5TVBFE, NSErrorFailingURLKey=/push/deviceRegistrations/0001EDAT3500GW0X476W5TVBFE, NSLocalizedDescription=unsupported URL}

Original support conversation: https://app.intercom.io/a/apps/ua39m1ld/inbox/inbox/conversation/21977960220

@lolwtfqt

This comment has been minimized.

Copy link

commented May 13, 2019

Potential issue:
All network requests inside ARTPushActivationStateMachine use [_rest executeRequest:request withAuthOption:ARTAuthenticationOn which appends the request to the baseURL, but only the deviceUpdateRegistration method uses:
[_rest executeRequest:request completion:
directly, which never appends the request path to the baseURL

@ricardopereira

This comment has been minimized.

Copy link
Collaborator

commented May 19, 2019

@lolwtfqt Sorry, I couldn't reproduce the issue. Which Ably version are you using? Could you send to us an example? Thank you in advance.

@lolwtfqt

This comment has been minimized.

Copy link

commented May 20, 2019

I am using the 1.1 iOS SDK and following the iOS direct push tutorial, after calling channel.push.registerDevice() the push activation state machine - (void)deviceUpdateRegistration:(ARTErrorInfo *)error method directly executes the @"/push/deviceRegistrations" request without a base url (you can try adding breakpoints to lines 240 and 241)

@ricardopereira

This comment has been minimized.

Copy link
Collaborator

commented May 23, 2019

This fix will be released in v1.1.5. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.