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

DeviceRegistration.register_apid takes optional hash #14

Conversation

johnnaegle
Copy link
Contributor

Make params (now named options) optional for Dirigible::DeviceRegistration.register_apid as it is for the other device registration calls

…ation.register_apid as it is for the other device registration calls
@anthonator
Copy link
Owner

Generally if I don't make params optional it's because the API is expecting them in all cases. Does UA require alias and/or tags when registering an APID or are they optional?

According to the UA documentation:

"Unlike registration for iOS and Blackberry applications, basic registration tying an APID to your application happens automatically. The registration API can be used to set tags or aliases."

So it seems to me that the purpose of the API call is to set tags/aliases but the documentation is a little ambiguous. Can you verify that it's not required?

@johnnaegle
Copy link
Contributor Author

I interpreted the API documentation the same as in the IOS registration: the tags and other parameters are optional, and if you are doing something different via an API call than via the device you might get unexpected behavior.

This seems to be relevant to answering the question you pose:

However, if you are setting tags via the API, you will need to add ..

That seems to imply the tags are optional.

Moreover, from the console, it registers the device without options:

> droid_token = "1111111-1111-1111-1111-111111111111"
> Dirigible::DeviceRegistration.register_apid(droid_token)
200
OK
=> nil

The 200/OK are the status and body from the response.

And I see my device registered:

> Dirigible::DeviceInformation.list_apids
{:apids=>
  [{
    "apid" : "01111111-1111-1111-1111-111111111111",
    "tags" : [ ],
    "alias" : null,
    "active" : true,
    "created" : "2014-01-29 17:54:13",
    "c2dm_registration_id" : null
  }]
}

@anthonator
Copy link
Owner

Thanks for verifying.

anthonator added a commit that referenced this pull request Jan 29, 2014
…gister_apid

DeviceRegistration.register_apid takes optional hash
@anthonator anthonator merged commit 0115c54 into anthonator:master Jan 29, 2014
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

Successfully merging this pull request may close these issues.

2 participants