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

Trying to create the special Parse "Installation" object for push notifications creates a new custom class called "Instllation" #75

Closed
nechmads opened this issue Mar 31, 2013 · 5 comments

Comments

@nechmads
Copy link

When trying to create a new Installation object for push notifications, instead of getting a new object from the Parse "special type" Installation, a new custom class is being created.

Code:
new_user = Parse::Object.new "Installation"
new_user["deviceType"] = "ios"
new_user["deviceToken"] = ios_token
new_user["channels"] = Array.new
new_user["channels"] << ""
new_user.save

@adelevie
Copy link
Owner

Was the typo in the title intentional? "Instllation" doesn't appear anywhere in master. If the typo was an accident, here's the reason why this isn't working:

Parse::Object#save points to /classes/[className]. To create an installation you need to POST to /installations.

This would require some additional code to fully support here. If you would like to add this feature, let me know and I can provide pretty decent help to get you going.

@nechmads
Copy link
Author

No. Typo was typo just here. The code is trying to create the "Installation" object.
I'll be happy to give it a shot if you can just direct me to the right direction to start with.

On Sunday, March 31, 2013 at 1:02 PM, Alan deLevie wrote:

Was the typo in the title intentional? "Instllation" doesn't appear anywhere in master. If the typo was an accident, here's the reason why this isn't working:
Parse::Object#save points to /classes/[className]. To create an installation (https://parse.com/docs/rest#installations-uploading) you need to POST to /installations.
This would require some additional code to fully support here. If you would like to add this feature, let me know and I can provide pretty decent help to get you going.


Reply to this email directly or view it on GitHub (#75 (comment)).

@adelevie
Copy link
Owner

I stubbed out the basic stuff here: de6c3c7. Just clone/pull and start where I left off.

Take a look at user.rb and object.rb for help.

Also: be sure to write some tests, even failing ones.

@nechmads
Copy link
Author

nechmads commented Apr 2, 2013

Hi.
Just had a chat with someone from Parse. There is a much easier solution. All you need is to use your current code and name the class "_Installation":
new_user = Parse::Object.new "_Installation"

Works like a charm.
You might want to add this to the documentation.
And thanks for the help!!

Shahar Nechmad
Stagedom, Founder/CEO
+1.415.307.5378
@nechmads / @stagedom

On Sunday, March 31, 2013 at 1:12 PM, Alan deLevie wrote:

I stubbed out the basic stuff here: de6c3c7 (de6c3c7). Just clone/pull and start where I left off.
Take a look at user.rb and object.rb for help.


Reply to this email directly or view it on GitHub (#75 (comment)).

@adelevie
Copy link
Owner

adelevie commented Apr 8, 2013

Thanks a lot @nechmads!

Feel free to add this to the readme or to features.md (this will eventually become the readme).

@adelevie adelevie closed this as completed Apr 8, 2013
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