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

Store push notification history / status #566

Closed
sakinasugra opened this issue Feb 22, 2016 · 21 comments
Closed

Store push notification history / status #566

sakinasugra opened this issue Feb 22, 2016 · 21 comments

Comments

@sakinasugra
Copy link

I have migrated my parse app successfully to locally setup parse server. I am able to register the device installation and also am able to send pushes from my device to other devices. But the pushes that I send are not saved either on the parse dashboard under push nor in my mognodb in _PushStatus. I am using iOS and below is the code that I have used:

              `NSString *post = [NSString stringWithFormat:@"{\"where\": {\"channels\": \"%@\"},\"data\": {\"action\": \"LOGOUT\",\"content-available\": \"1\",\"moduleIdentifier\":\"LOGOUT\",\"nTitle\":\"Password Changed\"}}",@"My_channel"];

                NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

                NSURL *url = [NSURL URLWithString:@"https://my_localhost_url/parse/push/"];

                NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];

                [request setHTTPMethod:@"POST"];

                [request addValue:@"My_App_Id" forHTTPHeaderField:@"X-Parse-Application-Id"];

                [request addValue:@"My_Master_Key" forHTTPHeaderField:@"X-Parse-Master-Key"];

                [request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

                [request setHTTPBody:postData];

                NSURLResponse *requestResponse;

                NSError *err;

                NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&requestResponse error:&err];`
@flovilmart
Copy link
Contributor

@sakinasugra there is no tracking of the push sending yet, PR are welcome

@gfosco gfosco changed the title Parse server does not save the pushes sent. Store push notification history / status Feb 22, 2016
@flovilmart
Copy link
Contributor

@gfosco was there an API / url scheme that was in place before?

@flovilmart
Copy link
Contributor

@sakinasugra can you give the columns/types of _PushStatus?

@gateway
Copy link

gateway commented Feb 22, 2016

Is this what you guys @flovilmart @gfosco are talking about? Where is this data stored its not in Core, im assuming this is another internal db for push in the parse.com system?

image

@flovilmart
Copy link
Contributor

That's what we're talking about. I'm not sure they are migrated when migrating an app. There is maybe more to do here than just scratching the surface of storing the push request results.
That also implies that push adapter implement a common callback for the push server response

@gateway
Copy link

gateway commented Feb 23, 2016

@flovilmart I would guess this data could be stored in a _Push class however it would be good for someone at parse @gfosco could maybe shed some light on what the schema might look like, also when a user clicks on a text message how do we know when its open, does iOS send something back to parse incrementing a counter?

@flovilmart
Copy link
Contributor

That Would be The analytics that are unimplemented as of now ;)

@sakinasugra
Copy link
Author

@flovilmart when I send a push from the parse website, the push is displayed on the parse website and also in my migrated database ( see the images)
screen shot 2016-02-23 at 10 40 38 am
screen shot 2016-02-23 at 10 42 43 am

but when I send the push from my ios app using my code, it does not get logged, neither in the parse website nor my migrated database but I receive the notification.
Is this not implemented yet or I have gone wrong somewhere??

@drew-gross
Copy link
Contributor

It hasn't been implemented yet. PRs welcome :)

@sakinasugra
Copy link
Author

Thank You.

@JohnMorales
Copy link

@drew-gross I would like to try to take this on

@flovilmart
Copy link
Contributor

@JohnMorales stay tuned for the spec !

@JohnMorales
Copy link

@flovilmart Sounds good,

On a side note is there a gitter, irc, or slack channel where direction and ideas are discussed? I don't seem to find anywhere discussing how to communicate w/ the project lead and interested parties beyond reading through comments on issues

@flovilmart
Copy link
Contributor

We're setting that up!

@flovilmart
Copy link
Contributor

@JohnMorales we've uploaded a Gist with the spec for the _PushStatus class here https://gist.github.com/flovilmart/bf64276507d685ae41f6.

Let me know if there are implementation details you're not sure about.

The work will likely to be in the src/Controllers/PushController.js and we'll need to add a callback/method to the PushAdapters to get the status of the sent pushes.

For now, don't worry about all the adapters, we can start by having something functional with ParsePushAdapter.js

Good luck and Thanks!

@gateway
Copy link

gateway commented Feb 25, 2016

👍 for Slack channel

@JohnMorales
Copy link

@gateway 👍 for the nick

@flovilmart
Copy link
Contributor

@JohnMorales did you make any progress on that?

@JohnMorales
Copy link

Sorry man, I was trying to figure out the overall architecture and was a
bit overwhelmed. It might make more sense for me to pick up something where
I can look at a similar task as a guide.

On Fri, Mar 11, 2016 at 9:17 PM, Florent Vilmart notifications@github.com
wrote:

@JohnMorales https://github.com/JohnMorales did you make any progress
on that?


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

@flovilmart
Copy link
Contributor

No big deal! Was just to know! This a kinda a tricky one is we wanna have delivery etc...

@gfosco
Copy link
Contributor

gfosco commented Mar 21, 2016

A PushStatus API was added in #1004.

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

6 participants