{"action":"closed","issue":{"url":"https://api.github.com/repos/wix/react-native-notifications/issues/32","repository_url":"https://api.github.com/repos/wix/react-native-notifications","labels_url":"https://api.github.com/repos/wix/react-native-notifications/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/wix/react-native-notifications/issues/32/comments","events_url":"https://api.github.com/repos/wix/react-native-notifications/issues/32/events","html_url":"https://github.com/wix/react-native-notifications/issues/32","id":203032718,"number":32,"title":"Push Token is never sent to JS on Android. ","user":{"login":"sachin-sable","id":3263453,"avatar_url":"https://avatars.githubusercontent.com/u/3263453?v=3","gravatar_id":"","url":"https://api.github.com/users/sachin-sable","html_url":"https://github.com/sachin-sable","followers_url":"https://api.github.com/users/sachin-sable/followers","following_url":"https://api.github.com/users/sachin-sable/following{/other_user}","gists_url":"https://api.github.com/users/sachin-sable/gists{/gist_id}","starred_url":"https://api.github.com/users/sachin-sable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sachin-sable/subscriptions","organizations_url":"https://api.github.com/users/sachin-sable/orgs","repos_url":"https://api.github.com/users/sachin-sable/repos","events_url":"https://api.github.com/users/sachin-sable/events{/privacy}","received_events_url":"https://api.github.com/users/sachin-sable/received_events","type":"User","site_admin":false},"labels":[{"id":519703286,"url":"https://api.github.com/repos/wix/react-native-notifications/labels/Android","name":"Android","color":"0e8a16","default":false},{"id":353610605,"url":"https://api.github.com/repos/wix/react-native-notifications/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-01-25T07:39:26Z","updated_at":"2017-02-03T06:07:06Z","closed_at":"2017-02-03T06:07:06Z","body":"I have been trying this since past 2 days. I have also tried debugging in library source code. But in the file GcmToken.java, sendTokenToJS() method is getting called. But \"reactContext\" is coming null. Following is my code. \r\n` mReactRootView = new ReactRootView(this.getApplicationContext());\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 ReactAppCallbackModules())\r\n                .addPackage(new WebViewBridgePackage())\r\n                .addPackage(new ReactNativeContacts())\r\n                .addPackage(new AndroidKeyboardAdjustPackage(this))\r\n                .addPackage(new RNNotificationsPackage(getApplication()))\r\n                .setUseDeveloperSupport(BuildConfig.DEBUG)\r\n                .setInitialLifecycleState(LifecycleState.RESUMED)\r\n                .build();\r\n\r\n mReactRootView.startReactApplication(mReactInstanceManager, \"ReactApp\", null);\r\n`\r\n**My Application Class has code**\r\n`\r\n     private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\r\n        @Override\r\n        protected boolean getUseDeveloperSupport() {\r\n            return BuildConfig.DEBUG;\r\n        }\r\n\r\n        @Override\r\n        protected List<ReactPackage> getPackages() {\r\n            return Arrays.<ReactPackage>asList(\r\n                    new MainReactPackage(),\r\n                    new RNNotificationsPackage(CoreApplication.this)\r\n            );\r\n        }\r\n    };\r\n\r\n    @Override\r\n    public ReactNativeHost getReactNativeHost() {\r\n        return mReactNativeHost;\r\n    }\r\n`\r\nThe only change in this is I am starting a React Application on specific Activity, that is my HomeActivity. Rest other activities such as Login, etc are written in Native Android.\r\n\r\nCan someone please help?"}}
{"actor":{"display_login":"sachin-sable"}}