0

I'm developing an app for iOS that uses Parse-Server for the backend. I have just configured the Amazon SNS adapter. The reason I installed this adapter is so that users can get real time notifications based on their interactions with other users.

After installing the SNS adapter, though, I'm having a lot of trouble understanding what I need to do. How do I implement the front-end code to interact with SNS and send users push notifications? Again, the goal is not for me to be able to send my own push notifications to all users, but for push notifications to automatically be sent based on actions within the app.

Thanks in advance

rici
  • 234,347
  • 28
  • 237
  • 341
mewthree
  • 1
  • 1

1 Answers1

0

What you can do is the following:

  1. add this module to your parse server project. This module is a custom adapter for AWS SNS service. You can easily add this module to your project via the following command

npm install parse-server-sns-adapter --save
  1. After adding the module and provide the relevant keys (from your AWS console) you need to make sure your users are subscribed to your push notification service by creating an Installation object inside your IOS app. You can read more about it in here

  2. Next, you need to create a cloud code function that will be triggered by your client app (or by cron job etc.) that will send the push notification to the relevant subscribers. Cloud code function that handle it must be created because parse-server requires master key in order to send a push to other users and the master key is available only on the server side. Since i already provide more than one answer how it can be done you can read one of the answers in here

If you still having issues or something is not clear please let me know.

Good luck :)

Community
  • 1
  • 1
Ran Hassid
  • 2,788
  • 1
  • 12
  • 20
  • I did everything you said, and on the client side, have it set so if the PFCloud.callFunctionInBackground works correctly, it will print out "Success". It's printing out success, but I'm not actually receiving any push notifications. Any idea why this is? I have push notifications enabled in Xcode, and I'm supplying both my development certificate and production certificate in my index.js – mewthree Nov 30 '16 at 01:43