{"action":"created","issue":{"url":"https://api.github.com/repos/Appboy/appboy-android-sdk/issues/57","repository_url":"https://api.github.com/repos/Appboy/appboy-android-sdk","labels_url":"https://api.github.com/repos/Appboy/appboy-android-sdk/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/Appboy/appboy-android-sdk/issues/57/comments","events_url":"https://api.github.com/repos/Appboy/appboy-android-sdk/issues/57/events","html_url":"https://github.com/Appboy/appboy-android-sdk/issues/57","id":172119583,"number":57,"title":"React Native 0.31 & Android In-App Messages","user":{"login":"jasonagnew","id":5786790,"avatar_url":"https://avatars.githubusercontent.com/u/5786790?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonagnew","html_url":"https://github.com/jasonagnew","followers_url":"https://api.github.com/users/jasonagnew/followers","following_url":"https://api.github.com/users/jasonagnew/following{/other_user}","gists_url":"https://api.github.com/users/jasonagnew/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonagnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonagnew/subscriptions","organizations_url":"https://api.github.com/users/jasonagnew/orgs","repos_url":"https://api.github.com/users/jasonagnew/repos","events_url":"https://api.github.com/users/jasonagnew/events{/privacy}","received_events_url":"https://api.github.com/users/jasonagnew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-19T12:23:08Z","updated_at":"2016-08-30T10:42:55Z","closed_at":null,"body":"I've implemented your platform into both iOS & Android, and managed to get Push Noficiations working on both iOS & Android pretty easy. I finished up adding In-App messaging to iOS yesterday and today moved on to Android, which for some reason doesn't appear to work. I'm using:\r\n\r\n```\r\nReact 0.31\r\nAppboy SDK 1.14.1\r\nAndroid Min SDK Version 19 \r\nTesting on Device Android v6.0.1\r\n```\r\n\r\n>Please Note: I'm not using `Appboy.getInstance(this).requestInAppMessageRefresh();` as it says its `Deprecated` [here]\r\n(https://appboy.github.io/appboy-android-sdk/javadocs/com/appboy/Appboy.html) even though it says to use it your [documentation](https://www.appboy.com/documentation/Android/#part-3-implementation-example)\r\n\r\nOn my `MainActivity.java` I added:\r\n```\r\n    @Override\r\n    public void onResume() {\r\n      super.onResume();\r\n      AppboyInAppMessageManager.getInstance().registerInAppMessageManager(this);\r\n      Log.e(\"MainActivity\", \"registerInAppMessageManager\");\r\n    }\r\n\r\n    @Override\r\n    public void onPause() {\r\n      super.onPause();\r\n      AppboyInAppMessageManager.getInstance().unregisterInAppMessageManager(this);\r\n      Log.e(\"MainActivity\", \"unregisterInAppMessageManager\");\r\n    }\r\n```\r\nWhich I've checked correctly registers and unregisters the `AppboyInAppMessageManager`. However, In-App messages don't show, you can see there received:\r\n\r\n```\r\nReceived broadcast message. Message: Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10 pkg=com.xxx cmp=com.xxx/com.appboy.AppboyGcmReceiver (has extras) }\r\n```\r\n\r\nIf you click on the noficiation `Appboy Test Send` it will correctly show the In-App message. I decided to see if I could get the function `beforeInAppMessageDisplayed` to run like we've used on iOS so I created a `ReactContextBaseJavaModule`:\r\n\r\n```\r\npublic class AppboyInAppMessagesModule extends ReactContextBaseJavaModule implements IInAppMessageManagerListener {\r\n\r\n    public AppboyInAppMessagesModule(ReactApplicationContext reactContext) {\r\n        super(reactContext);\r\n    }\r\n\r\n    @Override\r\n    public String getName() {\r\n        return \"AppboyInAppMessages\";\r\n    }\r\n\r\n    @Override\r\n    public boolean onInAppMessageReceived(IInAppMessage inAppMessage) {\r\n      return false;\r\n    }\r\n\r\n    @Override\r\n    public InAppMessageOperation beforeInAppMessageDisplayed(IInAppMessage inAppMessage) {\r\n      Log.e(\"AppboyInAppMessagesModule\", \"beforeInAppMessageDisplayed\");\r\n      return InAppMessageOperation.DISPLAY_NOW;\r\n    }\r\n\r\n    @Override\r\n    public boolean onInAppMessageClicked(IInAppMessage inAppMessage, InAppMessageCloser inAppMessageCloser) {\r\n      return true;\r\n    }\r\n\r\n    @Override\r\n    public boolean onInAppMessageButtonClicked(MessageButton button, InAppMessageCloser inAppMessageCloser) {\r\n      return true;\r\n    }\r\n\r\n    @Override\r\n    public void onInAppMessageDismissed(IInAppMessage inAppMessage) {}\r\n\r\n}\r\n```\r\nBut unfortunately `beforeInAppMessageDisplayed` is never fired. Any advice you could offer would be great, pehraps I've missed something small. Thanks"},"comment":{"url":"https://api.github.com/repos/Appboy/appboy-android-sdk/issues/comments/243401503","html_url":"https://github.com/Appboy/appboy-android-sdk/issues/57#issuecomment-243401503","issue_url":"https://api.github.com/repos/Appboy/appboy-android-sdk/issues/57","id":243401503,"user":{"login":"jasonagnew","id":5786790,"avatar_url":"https://avatars.githubusercontent.com/u/5786790?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonagnew","html_url":"https://github.com/jasonagnew","followers_url":"https://api.github.com/users/jasonagnew/followers","following_url":"https://api.github.com/users/jasonagnew/following{/other_user}","gists_url":"https://api.github.com/users/jasonagnew/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonagnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonagnew/subscriptions","organizations_url":"https://api.github.com/users/jasonagnew/orgs","repos_url":"https://api.github.com/users/jasonagnew/repos","events_url":"https://api.github.com/users/jasonagnew/events{/privacy}","received_events_url":"https://api.github.com/users/jasonagnew/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T10:42:55Z","updated_at":"2016-08-30T10:42:55Z","body":"Hi @Bucimis\r\n\r\nSorry for delay it's been a bank holiday here in the UK. Thanks for taking the time to run the app. First of it's great to know its set up correctly and perhaps this issue is more to do with differences between iOS and Android SDKs. On iOS In-App messages are instant, just like push. Whereas Android I have been unable to get one to show while the app is open, but as you said this might need me to close/open a session after the campaign started. \r\n\r\nI do have one question, as In-App also trigger a notification it can be a little confusing for the UI in the case where notifications trigger an Alert. What I did on iOS was catch the notification before passing it to React and check if had a category - it seems notifications on iOS always have a category even if its null, whereas In-App don't. \r\n\r\nhttps://github.com/jasonagnew/react-native-appboy/blob/master/ios/ReactNativeAppboy/AppDelegate.m#L66,L69\r\n\r\nHowever, on Android I've been unable to figure out a way to filter them. \r\n\r\nAny ideas round this would be great thanks."}}
{"actor":{"display_login":"jasonagnew"}}