Bom dia a todos,
-- estou começando a usar o parse.com, tentei usar o mesmo conforme guick start e não funcionou, verifiquei o painel do parse o mesmo registra algumas informação, mais as informação o "DeviceToken" e "GCMSenderId", estou enviando o alguns código.
Fiz a configuração do push no google, agora não sei qual é problema, gostaria muito da ajuda de vocês.
Manifesto:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.starter" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature"
android:name="com.parse.starter.permission.C2D_MESSAGE" />
<uses-permission android:name="com.parse.starter.permission.C2D_MESSAGE" />
<application
android:name=".StarterApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- <meta-data
android:name="com.parse.APPLICATION_ID"
android:value="@string/parse_app_id" />
<meta-data
android:name="com.parse.CLIENT_KEY"
android:value="@string/parse_client_key" /> -->
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: Change "com.parse.starter" to match your app's package name.
-->
<category android:name="com.parse.starter" />
</intent-filter>
</receiver>
</manifest>
Activity
/*
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.parse.starter;
import android.app.Application;
import android.provider.Settings;
import android.util.Log;
import android.widget.Toast;
import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseAnalytics;
import com.parse.ParseException;
import com.parse.ParseInstallation;
import com.parse.ParseUser;
import com.parse.PushService;
import com.parse.SaveCallback;
public class StarterApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
//Parse.initialize(this);
Parse.initialize(this, "XvbQbNipzPQCnWXTnY7kPuPhj8eeRCkWatZeDRTT", "dIGH4j7Kcszvxad1bxqSLNfUCRlHwViUsIxaxZUz");
//ParseUser.enableAutomaticUser();
//ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
//ParseACL.setDefaultACL(defaultACL, true);
ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
String deviceToken = (String) ParseInstallation.getCurrentInstallation().get("deviceToken");
String deviceType = (String) ParseInstallation.getCurrentInstallation().get("deviceType");
String GCMSenderId = (String) ParseInstallation.getCurrentInstallation().get("GCMSenderId");
//eviceToken = ParseInstallation.getCurrentInstallation().getInstallationId();
String s = ParseInstallation.getCurrentInstallation().getInstallationId();
Toast.makeText(getApplicationContext(), deviceToken, Toast.LENGTH_LONG).show();
}
});
}
}
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
0 comentários:
Postar um comentário