简体   繁体   English

如何将Rails后端的REST推送通知与Parse IOS SDK一起使用

[英]How to use Parse IOS SDK with REST Push Notifications from Rails Back-end

I am new to Rails and Parse, currently trying to use Parse Push REST API with an IOS app that has a Rails Back-end. 我是Rails和Parse的新手,目前正尝试将Parse Push REST API与具有Rails后端的IOS应用一起使用。

在此处输入图片说明

The Installations are created through REST API calls from the back-end to Parse. 通过从后端到解析的REST API调用来创建安装。

With that pattern is it possible to use the IOS SDK Client methods of PFInstallation ? 通过这种模式,是否可以使用PFInstallation的IOS SDK客户端方法? such as

if (application.applicationIconBadgeNumber != 0) {
    application.applicationIconBadgeNumber = 0;
    [[PFInstallation currentInstallation] saveInBackground];
}

Or in the case of Push Notifications from REST API, the Parse IOS SDK cannot be used? 还是在来自REST API的推送通知的情况下,无法使用Parse IOS SDK? Do PFInstallations also need to be linked to a PFUser? PFInstallations是否也需要链接到PFUser吗?

Not sure why you're trying to accomplish. 不知道为什么要尝试完成。

If you're using Parse only to send Push Notification, you shouldn't it too much trouble. 如果您仅使用“解析”来发送“推送通知”,那么就不应该太麻烦。 You should use either direct notification system (iOS/Android) or Urban Airship type of tool. 您应该使用直接通知系统(iOS / Android)或Urban Airship类型的工具。

If you have a better reason to user Parse then you should first read https://parse.com/docs/rest/guide#push-notifications . 如果您有更好的理由来使用Parse,则应首先阅读https://parse.com/docs/rest/guide#push-notifications

You could manually create installation using the Parse REST API (using the already collected iOS Push Token for exemple, don't know Android, sorry) or if you're using Rails you could use the gem: parse-ruby-client ( https://github.com/adelevie/parse-ruby-client#installations ). 您可以使用Parse REST API(例如,使用已经收集的iOS Push Token,例如,不知道Android,抱歉)手动创建安装,或者如果您使用的是Rails,则可以使用gem:parse-ruby-client( https: //github.com/adelevie/parse-ruby-client#installations )。

Then you can use the Parse REST API ( https://parse.com/docs/rest/guide#push-notifications-sending-pushes ). 然后,您可以使用Parse REST API( https://parse.com/docs/rest/guide#push-notifications-sending-pushes )。

Hope it answer your question. 希望它能回答您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM