{"action":"created","issue":{"url":"https://api.github.com/repos/alternadom/WiFiFlutter/issues/45","repository_url":"https://api.github.com/repos/alternadom/WiFiFlutter","labels_url":"https://api.github.com/repos/alternadom/WiFiFlutter/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/alternadom/WiFiFlutter/issues/45/comments","events_url":"https://api.github.com/repos/alternadom/WiFiFlutter/issues/45/events","html_url":"https://github.com/alternadom/WiFiFlutter/issues/45","id":502259826,"node_id":"MDU6SXNzdWU1MDIyNTk4MjY=","number":45,"title":"Crash when using in combination with firebase_messaging","user":{"login":"Niek","id":213140,"node_id":"MDQ6VXNlcjIxMzE0MA==","avatar_url":"https://avatars0.githubusercontent.com/u/213140?v=4","gravatar_id":"","url":"https://api.github.com/users/Niek","html_url":"https://github.com/Niek","followers_url":"https://api.github.com/users/Niek/followers","following_url":"https://api.github.com/users/Niek/following{/other_user}","gists_url":"https://api.github.com/users/Niek/gists{/gist_id}","starred_url":"https://api.github.com/users/Niek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Niek/subscriptions","organizations_url":"https://api.github.com/users/Niek/orgs","repos_url":"https://api.github.com/users/Niek/repos","events_url":"https://api.github.com/users/Niek/events{/privacy}","received_events_url":"https://api.github.com/users/Niek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-10-03T19:42:35Z","updated_at":"2019-10-07T07:08:24Z","closed_at":null,"author_association":"NONE","body":"When using firebase_messaging, you need to to[ add your own Application class that implements PluginRegistrantCallback](https://pub.dev/packages/firebase_messaging#optionally-handle-background-messages). However, this causes WiFiFlutter to crash with the following trace:\r\n```java\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125): Failed to handle method call\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.app.Activity.getApplicationContext()' on a null object reference\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at com.alternadom.wifiiot.WifiIotPlugin.<init>(WifiIotPlugin.java:65)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at com.alternadom.wifiiot.WifiIotPlugin.registerWith(WifiIotPlugin.java:76)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:26)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at com.mypack.myapp.Application.registerWith(Application.java:18)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.startBackgroundIsolate(FlutterFirebaseMessagingService.java:164)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onMethodCall(FirebaseMessagingPlugin.java:134)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at android.os.MessageQueue.nativePollOnce(Native Method)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at android.os.MessageQueue.next(MessageQueue.java:336)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at android.os.Looper.loop(Looper.java:174)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at android.app.ActivityThread.main(ActivityThread.java:7356)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at java.lang.reflect.Method.invoke(Native Method)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)\r\nE/MethodChannel#plugins.flutter.io/firebase_messaging(10125):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)\r\n```\r\n\r\nIt's coming from this call: https://github.com/alternadom/WiFiFlutter/blob/a8bb37f87425e45d2947e6c7c4e8b9416c886364/android/src/main/java/com/alternadom/wifiiot/WifiIotPlugin.java#L65"},"comment":{"url":"https://api.github.com/repos/alternadom/WiFiFlutter/issues/comments/538867214","html_url":"https://github.com/alternadom/WiFiFlutter/issues/45#issuecomment-538867214","issue_url":"https://api.github.com/repos/alternadom/WiFiFlutter/issues/45","id":538867214,"node_id":"MDEyOklzc3VlQ29tbWVudDUzODg2NzIxNA==","user":{"login":"alternadom","id":14965352,"node_id":"MDQ6VXNlcjE0OTY1MzUy","avatar_url":"https://avatars3.githubusercontent.com/u/14965352?v=4","gravatar_id":"","url":"https://api.github.com/users/alternadom","html_url":"https://github.com/alternadom","followers_url":"https://api.github.com/users/alternadom/followers","following_url":"https://api.github.com/users/alternadom/following{/other_user}","gists_url":"https://api.github.com/users/alternadom/gists{/gist_id}","starred_url":"https://api.github.com/users/alternadom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alternadom/subscriptions","organizations_url":"https://api.github.com/users/alternadom/orgs","repos_url":"https://api.github.com/users/alternadom/repos","events_url":"https://api.github.com/users/alternadom/events{/privacy}","received_events_url":"https://api.github.com/users/alternadom/received_events","type":"User","site_admin":false},"created_at":"2019-10-07T07:08:24Z","updated_at":"2019-10-07T07:08:24Z","author_association":"OWNER","body":"Hi,\r\n\r\nSeems your poActivity is null, can you show me your call to your WifiIotPlugin constructor ?"}}
{"actor":{"display_login":"alternadom"}}