Parse.com 初始化服务器
Parse.com Initialization Server
我最近参与了一个正在进行的 Android 应用程序项目,我必须更新该项目。在更改应用程序的某些功能时,我偶然发现了一些 Parse 初始化代码,经过一些研究,我猜测它应该通过 Parse 启用 Android 推送通知。
问题是,在阅读了一些 Parse 教程并尝试了很多关键搜索词之后,我无法在代码中找到 Parse 服务器的设置位置和连接位置。当前配置为:
// Using Parse-1.3.0.jar lib
// My Activity
Parse.initialize(this, "APP_ID", "CLIENT_KEY");
ParseAnalytics.trackAppOpened(getIntent());
PushService.setDefaultPushCallback(this, MYACTIVITY.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
// My AndroidManifest.xml
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
// That seems to be the only Parse related configuration...
那么应用程序如何知道连接到哪里呢?它使用哪种 Parse 服务器配置?
我知道 Parse 服务已停止,如果我们想继续使用 Parse,我们可能必须设置一个托管的 Parse 服务器,但首先我们需要了解它现在如何连接到 Parse。
如有任何帮助,我们将不胜感激。
感谢您的宝贵时间。
默认情况下,解析 SDK 连接到位于 https://api.parse.com
的托管解析服务器。
一旦设置好解析服务器实例并 运行,只需使用配置对象初始化 SDK:
Parse.Configuration configuration = new Parse.Configuration.Builder(this)
.applicationId(BuildConfig.PARSE_APPLICATION_ID)
.server("https://www.website.com/parse/")
.clientKey(BuildConfig.PARSE_CLIENT_KEY)
.build();
Parse.initialize(configuration);
如果您有任何其他问题,请随时询问。我不确定我得到你想问的。
ParseAnalytics
东西可能会消失,应该不再支持了。
we may have to set up a hosted Parse Server
:如果暂时停止应用程序对您来说是个问题,我认为您应该抓紧时间,因为截止日期(我认为是 1 月 28 日? ) 越来越近了。
- 当您更新为自己的
parse-server
时,推送通知将不适用于您的配置。阅读 here 了解更多信息。您将必须获得自己的 GCM(或 FCM,在本例中是相同的)密钥:
By default, the hosted Parse service (parse.com) sends pushes to your Android app with its own GCM sender ID. With your Parse Server, this setup will no longer work. Instead, your Parse Server will send GCM pushes with its own GCM sender ID and API key. You should register a GCM sender ID and update your app as soon as possible.
然后需要在清单中使用发件人 ID 作为:
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="@string/gcm_sender_id" />
无论如何,距离你现在的位置还有很长的路要走,此时你可能应该尽快设置 parse-server
,然后再升级 Android相应的应用程序。
我最近参与了一个正在进行的 Android 应用程序项目,我必须更新该项目。在更改应用程序的某些功能时,我偶然发现了一些 Parse 初始化代码,经过一些研究,我猜测它应该通过 Parse 启用 Android 推送通知。
问题是,在阅读了一些 Parse 教程并尝试了很多关键搜索词之后,我无法在代码中找到 Parse 服务器的设置位置和连接位置。当前配置为:
// Using Parse-1.3.0.jar lib
// My Activity
Parse.initialize(this, "APP_ID", "CLIENT_KEY");
ParseAnalytics.trackAppOpened(getIntent());
PushService.setDefaultPushCallback(this, MYACTIVITY.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
// My AndroidManifest.xml
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
// That seems to be the only Parse related configuration...
那么应用程序如何知道连接到哪里呢?它使用哪种 Parse 服务器配置?
我知道 Parse 服务已停止,如果我们想继续使用 Parse,我们可能必须设置一个托管的 Parse 服务器,但首先我们需要了解它现在如何连接到 Parse。
如有任何帮助,我们将不胜感激。
感谢您的宝贵时间。
默认情况下,解析 SDK 连接到位于 https://api.parse.com
的托管解析服务器。
一旦设置好解析服务器实例并 运行,只需使用配置对象初始化 SDK:
Parse.Configuration configuration = new Parse.Configuration.Builder(this)
.applicationId(BuildConfig.PARSE_APPLICATION_ID)
.server("https://www.website.com/parse/")
.clientKey(BuildConfig.PARSE_CLIENT_KEY)
.build();
Parse.initialize(configuration);
如果您有任何其他问题,请随时询问。我不确定我得到你想问的。
ParseAnalytics
东西可能会消失,应该不再支持了。we may have to set up a hosted Parse Server
:如果暂时停止应用程序对您来说是个问题,我认为您应该抓紧时间,因为截止日期(我认为是 1 月 28 日? ) 越来越近了。- 当您更新为自己的
parse-server
时,推送通知将不适用于您的配置。阅读 here 了解更多信息。您将必须获得自己的 GCM(或 FCM,在本例中是相同的)密钥:
By default, the hosted Parse service (parse.com) sends pushes to your Android app with its own GCM sender ID. With your Parse Server, this setup will no longer work. Instead, your Parse Server will send GCM pushes with its own GCM sender ID and API key. You should register a GCM sender ID and update your app as soon as possible.
然后需要在清单中使用发件人 ID 作为:
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="@string/gcm_sender_id" />
无论如何,距离你现在的位置还有很长的路要走,此时你可能应该尽快设置 parse-server
,然后再升级 Android相应的应用程序。