{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/283","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/283/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/283/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-Android/issues/283","id":120529106,"number":283,"title":"Unable to receive push notifications on android","user":{"login":"liangmicha","id":2748938,"avatar_url":"https://avatars.githubusercontent.com/u/2748938?v=3","gravatar_id":"","url":"https://api.github.com/users/liangmicha","html_url":"https://github.com/liangmicha","followers_url":"https://api.github.com/users/liangmicha/followers","following_url":"https://api.github.com/users/liangmicha/following{/other_user}","gists_url":"https://api.github.com/users/liangmicha/gists{/gist_id}","starred_url":"https://api.github.com/users/liangmicha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangmicha/subscriptions","organizations_url":"https://api.github.com/users/liangmicha/orgs","repos_url":"https://api.github.com/users/liangmicha/repos","events_url":"https://api.github.com/users/liangmicha/events{/privacy}","received_events_url":"https://api.github.com/users/liangmicha/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/labels/needs%20more%20info","name":"needs more info","color":"ffd182"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-05T04:53:29Z","updated_at":"2015-12-07T18:28:12Z","closed_at":null,"body":"Hello, I am having trouble getting through the tutorial on setting up test notifications on my android.\r\nI tested on three fronts: android samsung galaxy s3 4.1.2 (Actual device), s3 4.1.1 (emulator genymotion) and s5 4.4.4 (emulator genymotion). I go on parse.com and see installations on such devices. I notice that the deviceToken is empty is that a problem?\r\n\r\nI also didn't do any of the steps related to GCM because it said I didn't need to to see this general push notification.\r\n\r\nThe code is below. Basically I don't get any notifications on either of such devices.\r\n\r\nI verified the following lines in MainActivity.java ran:\r\n```\r\n        System.out.println(\"starting to initialize...\");\r\n        Parse.initialize(this,\r\n          \"SWAPPED_OUT_APP_ID_HERE\",\r\n          \"SWAPPED_OUT_KEY_HERE\");\r\n        ParseInstallation.getCurrentInstallation().saveInBackground();\r\n        System.out.println(\"finished initializing...\");\r\n```\r\n\r\nMainActivity.java\r\n```\r\npackage com.chat;\r\n\r\nimport android.app.Activity;\r\nimport android.os.Bundle;\r\nimport android.view.KeyEvent;\r\n\r\nimport com.facebook.react.LifecycleState;\r\nimport com.facebook.react.ReactInstanceManager;\r\nimport com.facebook.react.ReactRootView;\r\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\r\nimport com.facebook.react.shell.MainReactPackage;\r\nimport com.facebook.soloader.SoLoader;\r\nimport android.content.Intent;\r\n\r\nimport com.parse.Parse;\r\nimport com.parse.ParseInstallation;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\n\r\nimport com.magus.fblogin.FacebookLoginPackage;\r\nimport com.oblador.vectoricons.VectorIconsPackage;\r\n\r\npublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {\r\n\r\n    private ReactInstanceManager mReactInstanceManager;\r\n    private ReactRootView mReactRootView;\r\n    // declare package\r\n    private FacebookLoginPackage mFacebookLoginPackage;\r\n\r\n    private List<ActivityResultListener> mListeners = new ArrayList<>();\r\n\r\n    public void addActivityResultListener(ActivityResultListener listener){\r\n        mListeners.add(listener);\r\n    }\r\n\r\n    public ReactInstanceManager getMReactInstanceManager() {\r\n      return mReactInstanceManager;\r\n    }\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n\r\n        System.out.println(\"starting to initialize...\");\r\n        Parse.initialize(this,\r\n          \"SWAPPED_OUT_APP_ID_HERE\",\r\n          \"SWAPPED_OUT_KEY_HERE\");\r\n        ParseInstallation.getCurrentInstallation().saveInBackground();\r\n        System.out.println(\"finished initializing...\");\r\n\r\n        mReactRootView = new ReactRootView(this);\r\n\r\n        // instantiate package\r\n        mFacebookLoginPackage = new FacebookLoginPackage(this);\r\n\r\n        mReactInstanceManager = ReactInstanceManager.builder()\r\n                .setApplication(getApplication())\r\n                .setBundleAssetName(\"index.android.bundle\")\r\n                .setJSMainModuleName(\"index.android\")\r\n                .addPackage(new MainReactPackage())\r\n                .addPackage(new ComponentPackager())\r\n                .addPackage(new VectorIconsPackage())\r\n                .addPackage(new ImagePickerPackage(this))\r\n                .addPackage(mFacebookLoginPackage)\r\n                .setUseDeveloperSupport(BuildConfig.DEBUG)\r\n                .setInitialLifecycleState(LifecycleState.RESUMED)\r\n                .build();\r\n\r\n        mReactRootView.startReactApplication(mReactInstanceManager, \"Chat\", null);\r\n        setContentView(mReactRootView);\r\n    }\r\n\r\n    @Override\r\n    public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {\r\n        for (ActivityResultListener listener : mListeners) {\r\n            listener.onActivityResult(requestCode, resultCode, data);\r\n        }\r\n        // handle onActivityResult\r\n        //mFacebookLoginPackage.handleActivityResult(requestCode, resultCode, data);\r\n    }\r\n\r\n    @Override\r\n    public boolean onKeyUp(int keyCode, KeyEvent event) {\r\n        if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {\r\n            mReactInstanceManager.showDevOptionsDialog();\r\n            return true;\r\n        }\r\n        return super.onKeyUp(keyCode, event);\r\n    }\r\n\r\n    @Override\r\n    public void onBackPressed() {\r\n      if (mReactInstanceManager != null) {\r\n        mReactInstanceManager.onBackPressed();\r\n      } else {\r\n        super.onBackPressed();\r\n      }\r\n    }\r\n\r\n    @Override\r\n    public void invokeDefaultOnBackPressed() {\r\n      super.onBackPressed();\r\n    }\r\n\r\n    @Override\r\n    protected void onPause() {\r\n        super.onPause();\r\n\r\n        if (mReactInstanceManager != null) {\r\n            mReactInstanceManager.onPause();\r\n        }\r\n    }\r\n\r\n    @Override\r\n    protected void onResume() {\r\n        super.onResume();\r\n\r\n        if (mReactInstanceManager != null) {\r\n            mReactInstanceManager.onResume(this);\r\n        }\r\n    }\r\n\r\n}\r\n\r\n```\r\n\r\nHere is my manifest:\r\n```\r\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    package=\"com.chat\">\r\n\r\n    <uses-permission android:name=\"android.permission.INTERNET\" />\r\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\r\n    <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\r\n    <uses-permission android:name=\"android.permission.VIBRATE\" />\r\n    <uses-permission android:name=\"android.permission.GET_ACCOUNTS\" />\r\n    <uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\" />\r\n\r\n    <!--\r\n      IMPORTANT: Change \"com.parse.starter.permission.C2D_MESSAGE\" in the lines below\r\n      to match your app's package name + \".permission.C2D_MESSAGE\".\r\n    -->\r\n    <permission android:protectionLevel=\"signature\"\r\n        android:name=\"com.chat.permission.C2D_MESSAGE\" />\r\n    <uses-permission android:name=\"com.chat.permission.C2D_MESSAGE\" />\r\n\r\n    <application\r\n      android:allowBackup=\"true\"\r\n      android:label=\"@string/app_name\"\r\n      android:icon=\"@mipmap/ic_launcher\"\r\n      android:theme=\"@style/AppTheme\">\r\n\r\n      <activity\r\n        android:name=\".MainActivity\"\r\n        android:label=\"@string/app_name\"\r\n        android:windowSoftInputMode=\"adjustResize\"\r\n        android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize\"\r\n        >\r\n        <intent-filter>\r\n            <action android:name=\"android.intent.action.MAIN\" />\r\n            <category android:name=\"android.intent.category.LAUNCHER\" />\r\n        </intent-filter>\r\n      </activity>\r\n\r\n\r\n      <!--add FacebookActivity-->\r\n      <activity\r\n              android:name=\"com.facebook.FacebookActivity\"\r\n              android:configChanges=\"keyboard|keyboardHidden|screenLayout|screenSize|orientation\"\r\n              android:label=\"@string/app_name\"\r\n              android:theme=\"@android:style/Theme.Translucent.NoTitleBar\">\r\n      </activity>\r\n      <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\r\n\r\n      <meta-data\r\n        android:name=\"com.facebook.sdk.ApplicationId\"\r\n        android:value=\"@string/fb_app_id\"/>\r\n\r\n      <!--add parse push notifications-->\r\n      <service android:name=\"com.parse.PushService\" />\r\n      <receiver android:name=\"com.parse.ParsePushBroadcastReceiver\"\r\n          android:exported=\"false\">\r\n        <intent-filter>\r\n          <action android:name=\"com.parse.push.intent.RECEIVE\" />\r\n          <action android:name=\"com.parse.push.intent.DELETE\" />\r\n          <action android:name=\"com.parse.push.intent.OPEN\" />\r\n          </intent-filter>\r\n      </receiver>\r\n      <receiver android:name=\"com.parse.GcmBroadcastReceiver\"\r\n          android:permission=\"com.google.android.c2dm.permission.SEND\">\r\n        <intent-filter>\r\n          <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\r\n          <action android:name=\"com.google.android.c2dm.intent.REGISTRATION\" />\r\n\r\n          <!--\r\n            IMPORTANT: Change \"com.parse.starter\" to match your app's package name.\r\n          -->\r\n          <category android:name=\"com.chat\" />\r\n        </intent-filter>\r\n      </receiver>\r\n    <!--end parse push notifications-->\r\n    </application>\r\n\r\n</manifest>\r\n\r\n```\r\nHere is my build.gradle\r\n```\r\ndependencies {\r\n    compile fileTree(dir: 'libs', include: ['*.jar'])\r\n    ...\r\n    compile 'com.parse.bolts:bolts-android:1.2.1'\r\n    compile 'com.parse:parse-android:1.10.3'\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/comments/162615435","html_url":"https://github.com/ParsePlatform/Parse-SDK-Android/issues/283#issuecomment-162615435","issue_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/283","id":162615435,"user":{"login":"parse-github-bot","id":13906986,"avatar_url":"https://avatars.githubusercontent.com/u/13906986?v=3","gravatar_id":"","url":"https://api.github.com/users/parse-github-bot","html_url":"https://github.com/parse-github-bot","followers_url":"https://api.github.com/users/parse-github-bot/followers","following_url":"https://api.github.com/users/parse-github-bot/following{/other_user}","gists_url":"https://api.github.com/users/parse-github-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/parse-github-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parse-github-bot/subscriptions","organizations_url":"https://api.github.com/users/parse-github-bot/orgs","repos_url":"https://api.github.com/users/parse-github-bot/repos","events_url":"https://api.github.com/users/parse-github-bot/events{/privacy}","received_events_url":"https://api.github.com/users/parse-github-bot/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T18:28:12Z","updated_at":"2015-12-07T18:28:12Z","body":"Thank you for your feedback.  We prioritize issues that have clear and concise repro steps.  Please see our [Bug Reporting Guidelines] (../blob/master/CONTRIBUTING.md#bugs) about what information should be added to this issue.<br /><br />Please try the latest SDK. Our [release notes](../releases) have details about what issues were fixed in each release.<br /><br />In addition, you might find the following resources helpful:<ul><li>Documentation: https://www.parse.com/docs</li><li>Google Groups: https://groups.google.com/forum/#!forum/parse-developers</li><li>Stack Overflow: http://stackoverflow.com/tags/parse.com</li></ul>"}}