-
Notifications
You must be signed in to change notification settings - Fork 352
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
Push notifications #7
Comments
Great question. Before I start explaining, please correct me if I'm wrong. I think I have enough experience with push notifications (Jasonette started out as something extracted out from a messaging app. As far as I know, push notification in most cases is a server-side thing. Let me use a messaging app as an example:
Of course, there is a way to bypass this. For example if Jane's phone knows exactly what John's That said, there are many ways to tackle this problem.
The project is not yet at a stage where I want to make a decision on whether I will build a dedicated push broker service (Option 3) or not. And honestly I think building Jasonette into something that's tightly coupled with a "special server" may limit its potential. I think option 2 feels most rational at this point, since you still have a way to send device tokens to your server without touching any native code, but you're not tied to a specific push provider. But again, let me know if you know a better solution. Otherwise I will soon start working on the 'option 2' and post an update here :) |
An action for sending tokens and new system event which would be fired when a push message arrives would be cool. I fully agree that writing yet another push service backend would bind jasonette too tightly to one implementation. OTOH I see that both UA and MS Azure require hooking their own frameworks on the client (iOS) side. I think makes it very difficult to come up with a generic solution for a system event. |
Here's the push notification branch: https://github.com/Jasonette/JASONETTE-iOS/compare/push_notification?expand=1 I've just tested it and it works on mine, but as is always with push notifications you need to jump through a couple of certificate hoops. I'm assuming you have an apple developer account, since that's the only way to support push notifications. Anyway, to make this work, you should:
Note that these are not Jasonette related steps but something anyone who wants to implement push notification on iOS needs to go through. Once you're all set up, this is how the new API should work:
One more thing, I'm attaching the server-side code (it's an AWS lambda function but you can do whatever you want) I used to get it to work just in case. It's all hard-coded because it's just for validating the API:
If Anybody actually tries this out, please share the results. I would appreciate it. Then I should be able to merge this to master much faster.Won't close this until I merge this with master.Also, please feel free to point out if I'm missing anything from the diff |
Oh WOW. |
I will try it |
Ok, so I allocated some time to get this working with Azure Notification Hub -- just because we happen to have some Azure stuff running internally. I probably need to hack the code a bit for that to work, will do on a separate branch. |
Just wanted to mention that this code works beautifully. I think this issue could be closed now. |
I also confirm that this works fine, but there's one thing that's been bothering me, which is why I didn't merge this to master yet: #53 I hope some has a good solution for this! |
I was able to use this branch and push notifications worked well! I did have to enable the 'capability' manually. Also, I am using Firebase for pushes, so I had to adjust the JasonAppDelegate to register with the proper endpoints. |
this version seems to be missing file:// .... how do we reference local files from settings.plist? |
Great project!
What about push notifications?
The text was updated successfully, but these errors were encountered: