DEV Community

Discussion on: Android & iOS Push Notifications with Stream Chat and React Native

Collapse
 
kosaikham profile image
sai lao kham • Edited

Thank you for this tutorial and I encountered some errors when I followed this code,

return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ReactNativePushNotificationPackage() // <---- & THIS      
      );

1) first error is that about using Arrays.<ReactPackage>asList and there is no import statment of Arrays. So I import this import java.util.Arrays;

2) second error is that about new MainReactPackage() and there is no import statement of MainReactPackage() at the top of the file. So I commented out this new MainReactPackage().

3) finally, the app can build without errors, BUT a new error occurs on the app displaying AppState is not available in this app..

And please let me know if you know some solutions. Thank you.

Collapse
 
gezhouz profile image
gezhou zhang • Edited

you can try add

"import com.facebook.react.shell.MainReactPackage;"

in your MainApplication.java