Comments (32)
- Thanks for the great feedback!
- I'll try to work out a summary of guidelines to use our notifications lib with RNN into a wiki. There are some things to pay attention to -- would rather create a thorough summary for everyone's usage.
from react-native-notifications.
Same. I've just started integrating with a Rnn app. A guide or example would really help.
from react-native-notifications.
@d4vidi any news on this? I have setup RNNavigation and RNNotifications on the same project and in IOS works fine the only thing that seems to be non-working is the consumeBackgroundQueue that doesn't do anything, any pointers?
from react-native-notifications.
Thanks for all your help @lodev09 @d4vidi, it looks like it was a Google/Play services package conflict
from react-native-notifications.
@d4vidi did you get anywhere with this?
from react-native-notifications.
I'm also interested because right now I'm having problems with some events not firing and I'd like to know if there is some gotcha related to this or not.
from react-native-notifications.
I thought it's only me but yeah consumeBackgroundQueue
not working too.. :)
from react-native-notifications.
@enahum @lodev09 consumeBackgroundQueue
has no effect on Android. You are hence obliged to use a more simplified API for querying the initial notification, if needed...
In any case, please follow this wiki before proceeding with anything else.
Thanks!
from react-native-notifications.
Yes I know, but is not working on IOS, dunno if this is relevant but it doesn't when using with react-native-navigation
from react-native-notifications.
@enahum let's move this discussion back to issue #35...
from react-native-notifications.
@d4vidi I'm having trouble getting this up and running with RNN, even with the wiki. Do you have an example of these used in conjunction please?
Currently, I'm getting loads of error: cannot find symbol
errors when creating the classes discussed in the wiki.
from react-native-notifications.
So I've managed to fix most of the symbol errors by importing the relevant classes, however I still cannot get the CustomPushNotification.java
class to work.
My MainApplication.java
looks like this:
package com.my.testapp;
import android.app.Application;
import android.support.annotation.Nullable;
// Had to import these fix a load of errors
import android.content.Context;
import android.os.Bundle;
import com.facebook.react.ReactApplication;
import com.wix.interactable.Interactable;
import com.airbnb.android.react.maps.MapsPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import ch.uepaa.p2pkit.reactnative.PPKReactBridgePackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.reactnativenavigation.NavigationApplication;
import com.wix.reactnativenotifications.RNNotificationsPackage;
// Had to import these to fix a load of errors
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
import com.wix.reactnativenotifications.core.notification.IPushNotification;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends NavigationApplication implements INotificationsApplication {
private NotificationsLifecycleFacade notificationsLifecycleFacade;
@Override
public void onCreate() {
super.onCreate();
//...
// Create an object of the custom facade impl
notificationsLifecycleFacade = new NotificationsLifecycleFacade();
// Attach it to react-native-navigation
setActivityCallbacks(notificationsLifecycleFacade);
}
@Override
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
return new CustomPushNotification(
context,
bundle,
notificationsLifecycleFacade, // Instead of defaultFacade!!!
defaultAppLaunchHelper,
new JsIOHelper()
);
}
@Override
public boolean isDebug() {
// Make sure you are using BuildConfig from your own application
return BuildConfig.DEBUG;
}
// @Override
protected List<ReactPackage> getPackages() {
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
// new RNBackgroundGeolocation(),
new VectorIconsPackage(),
new PPKReactBridgePackage(),
new RNNotificationsPackage(MainApplication.this)
);
}
@Nullable
@Override
public List<ReactPackage> createAdditionalReactPackages() {
// return null;
return getPackages();
}
}
I'm still getting:
MainApplication.java:49: error: cannot find symbol
return new CustomPushNotification(
^
symbol: class CustomPushNotification
location: class MainApplication
CustomPushNotification.java
:
import com.wix.reactnativenotifications.RNNotificationsPackage;
import com.wix.reactnativenotifications.core.notification.PushNotification;
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
import android.content.Context;
import android.os.Bundle;
public class CustomPushNotification extends PushNotification {
public CustomPushNotification(Context context, Bundle bundle, AppLifecycleFacade appLifecycleFacade, AppLaunchHelper appLaunchHelper, JsIOHelper jsIoHelper) {
super(context, bundle, appLifecycleFacade, appLaunchHelper, jsIoHelper);
}
}
from react-native-notifications.
Apologies for spamming this thread :( but I've got a bit further. I fixed previous error by adding the line package com.test.myapp;
to the top of my custom notification class.
However, the app now just crashes again on boot. Attached the stack trace in hopes it makes sense to someone :(
06-06 17:11:38.515 2416 2627 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.my.testapp/.MainActivity (has extras)} from uid 10009 on display 0
06-06 17:11:38.538 2416 2430 W BroadcastQueue: Permission Denial: receiving Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$GmsExternalReceiver requires com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS due to sender com.android.launcher3 (uid 10009)
06-06 17:11:38.539 2416 2430 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.android.launcher3 (pid=3724, uid=10009) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.gms/.icing.proxy.ApplicationLauncherReceiver
06-06 17:11:38.539 2416 2430 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.android.launcher3 (pid=3724, uid=10009) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.googlequicksearchbox/com.google.android.search.core.icingsync.ApplicationLaunchReceiver
06-06 17:11:38.565 9718 9718 I art : Not late-enabling -Xcheck:jni (already on)
06-06 17:11:38.567 2416 3079 I ActivityManager: Start proc 9718:com.my.testapp/u0a60 for activity com.my.testapp/.MainActivity
06-06 17:11:38.573 1276 1314 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
06-06 17:11:38.584 2416 2435 D : HostConnection::get() New Host Connection established 0x9b3fed40, tid 2435
06-06 17:11:38.854 9718 9718 W art : Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-06 17:11:38.996 9718 9718 V fb-UnpackingSoSource: locked dso store /data/user/0/com.my.testapp/lib-main
06-06 17:11:39.000 9718 9718 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.my.testapp/lib-main
06-06 17:11:39.000 9718 9718 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.my.testapp/lib-main
06-06 17:11:39.065 9718 9718 I art : Thread[1,tid=9718,Native,Thread*=0xb4074500,peer=0x74367f68,"main"] recursive attempt to load library "/data/app/com.my.testapp-1/lib/x86/libfb.so"
06-06 17:11:39.086 1276 1650 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
06-06 17:11:39.100 9718 9735 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-06 17:11:39.124 9718 9718 D : HostConnection::get() New Host Connection established 0xad158f40, tid 9718
06-06 17:11:39.258 9718 9735 D : HostConnection::get() New Host Connection established 0xae39c580, tid 9735
06-06 17:11:39.291 9718 9735 I OpenGLRenderer: Initialized EGL, version 1.4
06-06 17:11:39.299 9718 9735 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
06-06 17:11:39.310 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
06-06 17:11:39.313 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
06-06 17:11:39.367 1276 1312 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:39.369 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
06-06 17:11:39.370 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
06-06 17:11:39.372 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
06-06 17:11:39.372 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
06-06 17:11:39.379 1276 1312 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:39.384 1276 1312 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:39.398 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
06-06 17:11:39.403 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
06-06 17:11:39.453 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
06-06 17:11:39.453 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
06-06 17:11:39.453 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
06-06 17:11:39.461 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
06-06 17:11:39.461 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
06-06 17:11:39.479 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
06-06 17:11:39.511 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
06-06 17:11:39.519 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
06-06 17:11:39.534 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
06-06 17:11:39.542 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
06-06 17:11:39.552 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
06-06 17:11:39.567 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
06-06 17:11:39.584 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
06-06 17:11:39.604 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
06-06 17:11:39.633 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
06-06 17:11:39.641 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
06-06 17:11:39.662 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
06-06 17:11:39.667 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
06-06 17:11:39.701 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
06-06 17:11:39.793 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
06-06 17:11:39.805 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
06-06 17:11:39.806 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
06-06 17:11:39.806 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
06-06 17:11:39.823 2416 2435 I ActivityManager: Displayed com.my.testapp/.MainActivity: +1s268ms (total +23s3ms)
06-06 17:11:39.837 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
06-06 17:11:39.840 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
06-06 17:11:39.849 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
06-06 17:11:39.850 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
06-06 17:11:39.859 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
06-06 17:11:39.864 9718 9728 I art : Background partial concurrent mark sweep GC freed 30560(2MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 2033KB/3MB, paused 2.544ms total 176.563ms
06-06 17:11:39.864 9718 9734 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.reactnativenavigation.views.managers.SharedElementTransitionManager
06-06 17:11:39.912 9718 9734 W unknown:React: Initializing React Xplat Bridge.
06-06 17:11:39.916 3724 3776 E Surface : getSlotFromBufferLocked: unknown buffer: 0x9fc57de0
06-06 17:11:39.919 9718 9734 W unknown:React: Initializing React Xplat Bridge before initializeBridge
06-06 17:11:39.947 9718 9734 W unknown:React: Initializing React Xplat Bridge after initializeBridge
06-06 17:11:39.948 9718 9718 W unknown:React: Packager connection already open, nooping.
06-06 17:11:39.948 9718 9718 W unknown:React: Inspector connection already open, nooping.
06-06 17:11:39.949 9718 9743 D ReactNativeNotifs: Native module init
06-06 17:11:39.970 9718 9746 I ReactNativeNotifs: App initialized => asking for new token
06-06 17:11:39.987 9718 9746 E AndroidRuntime: FATAL EXCEPTION: IntentService[GcmInstanceIdRefreshHandlerService]
06-06 17:11:39.987 9718 9746 E AndroidRuntime: Process: com.my.testapp, PID: 9718
06-06 17:11:39.987 9718 9746 E AndroidRuntime: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw' appears in /data/app/com.my.testapp-1/base.apk)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.google.android.gms.iid.zzd.zzeK(Unknown Source)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmToken.getNewToken(GcmToken.java:88)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmToken.refreshToken(GcmToken.java:77)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmToken.onAppReady(GcmToken.java:66)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmInstanceIdRefreshHandlerService.onHandleIntent(GcmInstanceIdRefreshHandlerService.java:23)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-06 17:11:39.987 9718 9746 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)
06-06 17:11:40.091 2416 2435 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
06-06 17:11:40.125 2416 2427 W ActivityManager: Force finishing activity com.my.testapp/.MainActivity
06-06 17:11:40.309 1276 1876 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x333 imply creation of host color buffer
06-06 17:11:40.325 2416 2427 D : HostConnection::get() New Host Connection established 0x9b432380, tid 2427
06-06 17:11:40.349 1276 1276 E EGL_emulation: tid 1276: eglCreateSyncKHR(1660): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-06 17:11:40.403 2416 2427 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
06-06 17:11:40.413 2416 2625 W art : Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=0 for 417ms
06-06 17:11:40.413 2416 2416 W art : Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=1 for 402ms
06-06 17:11:40.414 2416 2430 W art : Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=2 for 140ms
06-06 17:11:40.492 1276 1876 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:40.509 1276 1314 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:40.512 1276 1314 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:40.585 9718 9735 E Surface : getSlotFromBufferLocked: unknown buffer: 0xaa94a1f0
06-06 17:11:40.632 2416 4463 I OpenGLRenderer: Initialized EGL, version 1.4
06-06 17:11:40.660 1276 1312 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:40.699 1276 1312 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:40.703 1276 1312 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:40.726 2416 3701 I AccountManagerService: getTypesVisibleToCaller: isPermitted? true
06-06 17:11:40.823 9718 9743 I WebViewFactory: Loading com.android.webview version 44.0.2403.119 (code 246011910)
06-06 17:11:40.916 9718 9743 W System : ClassLoader referenced unknown path: /system/app/webview/lib/x86
06-06 17:11:40.928 9718 9743 I LibraryLoader: Time to load native libraries: 5 ms (timestamps 1878-1883)
06-06 17:11:40.929 9718 9743 I LibraryLoader: Expected native library version number "",actual native library version number ""
06-06 17:11:40.961 9718 9743 W art : Attempt to remove non-JNI local reference, dumping thread
06-06 17:11:41.510 9718 9742 I ReactNativeJS: 'user config', { rehydrate: true,
06-06 17:11:41.510 9718 9742 I ReactNativeJS: persist: [Function],
06-06 17:11:41.510 9718 9742 I ReactNativeJS: detectNetwork: [Function],
06-06 17:11:41.510 9718 9742 I ReactNativeJS: batch: [Function],
06-06 17:11:41.510 9718 9742 I ReactNativeJS: effect: [Function],
06-06 17:11:41.510 9718 9742 I ReactNativeJS: retry: [Function],
06-06 17:11:41.510 9718 9742 I ReactNativeJS: discard: [Function] }
06-06 17:11:41.511 9718 9742 I ReactNativeJS: 'Creating offline store', { rehydrate: true,
06-06 17:11:41.511 9718 9742 I ReactNativeJS: persist: [Function],
06-06 17:11:41.511 9718 9742 I ReactNativeJS: detectNetwork: [Function],
06-06 17:11:41.511 9718 9742 I ReactNativeJS: batch: [Function],
06-06 17:11:41.511 9718 9742 I ReactNativeJS: effect: [Function],
06-06 17:11:41.511 9718 9742 I ReactNativeJS: retry: [Function],
06-06 17:11:41.511 9718 9742 I ReactNativeJS: discard: [Function] }
06-06 17:11:41.728 2416 2625 I ActivityManager: START u0 {act=android.intent.action.VIEW flg=0x10008000 cmp=com.my.testapp/com.reactnativenavigation.controllers.NavigationActivity (has extras)} from uid 10060 on display 0
06-06 17:11:41.850 1276 1876 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
06-06 17:11:41.854 2416 2435 D : HostConnection::get() New Host Connection established 0x9b432840, tid 2435
06-06 17:11:41.903 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.904 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.904 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.904 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.951 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.951 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.951 9718 9718 W AHBottomNavigation: The items list should have at least 3 items
06-06 17:11:41.963 9718 9718 W unknown:React: Packager connection already open, nooping.
06-06 17:11:41.963 9718 9718 W unknown:React: Inspector connection already open, nooping.
06-06 17:11:41.975 9718 9718 D ReactNativeNotifs: onHostResume
06-06 17:11:41.975 9718 9718 D ReactNativeNotifs: App is now visible
06-06 17:11:41.982 2416 2430 W BroadcastQueue: Skipping deliver [background] BroadcastRecord{21c7209 u-1 android.net.conn.CONNECTIVITY_CHANGE} to ReceiverList{c797fd3 9718 com.my.testapp/10060/u0 remote:a38c5c2}: process crashing
06-06 17:11:41.987 9718 9718 D NotificationsLifecycleFacade: Activity is now visible (com.reactnativenavigation.controllers.NavigationActivity@52ed1e8)
06-06 17:11:42.010 1276 1314 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:42.035 1276 1876 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:42.039 1276 1876 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-06 17:11:42.114 3724 3776 E Surface : getSlotFromBufferLocked: unknown buffer: 0x9fc57de0
06-06 17:11:42.133 9718 9742 I ReactNativeJS: Running application "app.Profile" with appParams: {"initialProps":{"screenInstanceID":"screenInstanceID2","navigatorID":"navigatorID1_nav0","navigatorEventID":"screenInstanceID2_events"},"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
06-06 17:11:42.149 2416 2435 I ActivityManager: Displayed com.my.testapp/com.reactnativenavigation.controllers.NavigationActivity: +345ms
06-06 17:11:42.359 2416 2435 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
06-06 17:11:42.508 9718 9742 I ReactNativeJS: Running application "app.Timeline" with appParams: {"initialProps":{"screenInstanceID":"screenInstanceID4","navigatorID":"navigatorID3_nav1","navigatorEventID":"screenInstanceID4_events"},"rootTag":11}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
06-06 17:11:45.776 3224 9751 W PlatformStatsUtil: Could not retrieve Usage & Diagnostics setting. Giving up.
06-06 17:12:00.068 1276 1319 D hwcomposer: hw_composer sent 2071 syncs in 60s
from react-native-notifications.
Put your CustomPushNotification.java
under the same directory of MainApplication.java
. I have this code in my case:
package com.test;
import android.content.Context;
import android.os.Bundle;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.notification.PushNotification;
/**
* Overrides the default PushNotification implementation to create a
* notification with a layout similar to the 'The Big Meeting' notification,
* showing in the screenshot above.
*/
public class AppPushNotification extends PushNotification {
public AppPushNotification(Context context, Bundle bundle, NotificationsLifecycleFacade appLifecycleFacade, AppLaunchHelper appLaunchHelper, JsIOHelper jsIoHelper) {
super(context, bundle, appLifecycleFacade, appLaunchHelper, jsIoHelper);
}
}
Note: it's named AppPushNotification
on mine. Also, you need to configure the Facade
thing (I guess you have that already)
from react-native-notifications.
@lodev09 that's where it is already.
Regarding the facade, I have copy-pasted the file from the gist mentioned in the wiki, and I assume configuring is this section in the MainApplication.java
:
private NotificationsLifecycleFacade notificationsLifecycleFacade;
@Override
public void onCreate() {
super.onCreate();
//...
// Create an object of the custom facade impl
notificationsLifecycleFacade = new NotificationsLifecycleFacade();
// Attach it to react-native-navigation
setActivityCallbacks(notificationsLifecycleFacade);
}
from react-native-notifications.
I have updated and renamed my custom class to the same as yours @lodev09, but still as soon as I add new RNNotificationsPackage(MainApplication.this)
to:
protected List<ReactPackage> getPackages() {
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
// new RNBackgroundGeolocation(),
new VectorIconsPackage(),
new PPKReactBridgePackage(),
new RNNotificationsPackage(MainApplication.this)
);
}
the app just crashes on boot :(
from react-native-notifications.
so you're saying that it did compile? Maybe it has something to do with your JS side
from react-native-notifications.
Oh yes it compiles, it compiled before I changed the custom class too. But as soon as I add new RNNotificationsPackage(MainApplication.this)
the app crashes as soon as it boots - doesn't seem to get as far as the JS stuff
from react-native-notifications.
@lodev09 what do you have in your MainApplication.java
?
from react-native-notifications.
// https://github.com/wix/react-native-navigation/wiki/Android
package com.test;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.airbnb.android.react.maps.MapsPackage;
import com.reactnative.photoview.PhotoViewPackage;
import com.wix.reactnativenotifications.RNNotificationsPackage;
import com.futurice.rctaudiotoolkit.AudioPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.joshblour.reactnativepermissions.ReactNativePermissionsPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import io.realm.react.RealmReactPackage;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
// import com.reactnativenavigation.RnnPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
// import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.reactnativenavigation.NavigationApplication;
// https://github.com/wix/react-native-navigation/issues/629
import com.reactnativenavigation.controllers.ActivityCallbacks;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
import com.wix.reactnativenotifications.core.notification.IPushNotification;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends NavigationApplication implements INotificationsApplication {
/*private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MapsPackage(),
new PhotoViewPackage(),
new RNNotificationsPackage(),
new AudioPackage(),
new RNDeviceInfo(),
new ReactNativePermissionsPackage(),
new RnnPackage(),
new RNFetchBlobPackage(),
new RealmReactPackage(),
new RCTCameraPackage(),
new VectorIconsPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}*/
private NotificationsLifecycleFacade notificationsLifecycleFacade;
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
//...
// Create an object of the custom facade impl
notificationsLifecycleFacade = new NotificationsLifecycleFacade();
// Attach it to react-native-navigation
setActivityCallbacks(notificationsLifecycleFacade);
}
@Override
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
return new AppPushNotification(
context,
bundle,
notificationsLifecycleFacade, // Instead of defaultFacade!!!
defaultAppLaunchHelper,
new JsIOHelper()
);
}
@Override
public boolean isDebug() {
// Make sure you are using BuildConfig from your own application
return BuildConfig.DEBUG;
}
// @NonNull
@Nullable
@Override
public List<ReactPackage> createAdditionalReactPackages() {
// Add the packages you require here.
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
new AudioPackage(),
new MapsPackage(),
new PhotoViewPackage(),
new RNNotificationsPackage(MainApplication.this),
new RNDeviceInfo(),
new RNFetchBlobPackage(),
new RealmReactPackage(),
new RCTCameraPackage(),
new VectorIconsPackage(),
new ReactNativePermissionsPackage()
);
}
}
from react-native-notifications.
from react-native-notifications.
goodluck :)
from react-native-notifications.
@chrise86 could you paste in the exception message + stacktrace?
from react-native-notifications.
06-12 13:22:18.710 1618 1949 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.my.testapp/.MainActivity (has extras)} from uid 10009 on display 0
06-12 13:22:18.717 1618 1632 W BroadcastQueue: Permission Denial: receiving Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$GmsExternalReceiver requires com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS due to sender com.android.launcher3 (uid 10009)
06-12 13:22:18.717 1618 1632 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.android.launcher3 (pid=1988, uid=10009) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.gms/.icing.proxy.ApplicationLauncherReceiver
06-12 13:22:18.718 1618 1632 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.android.launcher3 (pid=1988, uid=10009) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.googlequicksearchbox/com.google.android.search.core.icingsync.ApplicationLaunchReceiver
06-12 13:22:18.735 4142 4142 I art : Not late-enabling -Xcheck:jni (already on)
06-12 13:22:18.737 1618 1629 I ActivityManager: Start proc 4142:com.my.testapp/u0a61 for activity com.my.testapp/.MainActivity
06-12 13:22:18.768 1349 1647 D AudioFlinger: mixer(0xb4480000) throttle end: throttle time(11)
06-12 13:22:18.771 1260 1317 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
06-12 13:22:18.796 1618 1637 D : HostConnection::get() New Host Connection established 0x9ecf75c0, tid 1637
06-12 13:22:18.974 4142 4142 W art : Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-12 13:22:19.098 4142 4142 V fb-UnpackingSoSource: locked dso store /data/user/0/com.my.testapp/lib-main
06-12 13:22:19.098 4142 4142 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.my.testapp/lib-main
06-12 13:22:19.098 4142 4142 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.my.testapp/lib-main
06-12 13:22:19.298 1260 2003 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
06-12 13:22:19.321 4142 4161 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-12 13:22:19.481 4142 4142 D : HostConnection::get() New Host Connection established 0xaaa75980, tid 4142
06-12 13:22:19.654 4142 4161 D : HostConnection::get() New Host Connection established 0xaaa75ec0, tid 4161
06-12 13:22:19.674 4142 4161 I OpenGLRenderer: Initialized EGL, version 1.4
06-12 13:22:19.674 4142 4161 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
06-12 13:22:19.772 1260 2024 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:19.782 4142 4169 I art : Thread[20,tid=4169,Native,Thread*=0xac3f7b00,peer=0x12e3b100,"AsyncTask #3"] recursive attempt to load library "/data/app/com.my.testapp-1/lib/x86/libfb.so"
06-12 13:22:19.803 1260 1355 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:19.807 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
06-12 13:22:19.807 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
06-12 13:22:19.809 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
06-12 13:22:19.809 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
06-12 13:22:19.810 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
06-12 13:22:19.810 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
06-12 13:22:19.811 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
06-12 13:22:19.814 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
06-12 13:22:19.819 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
06-12 13:22:19.820 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
06-12 13:22:19.821 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
06-12 13:22:19.827 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
06-12 13:22:19.828 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
06-12 13:22:19.834 1260 1355 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:19.835 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
06-12 13:22:19.840 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
06-12 13:22:19.840 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
06-12 13:22:19.841 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
06-12 13:22:19.843 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
06-12 13:22:19.844 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
06-12 13:22:19.846 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
06-12 13:22:19.851 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
06-12 13:22:19.859 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
06-12 13:22:19.875 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
06-12 13:22:19.882 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
06-12 13:22:19.883 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
06-12 13:22:19.884 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
06-12 13:22:19.884 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
06-12 13:22:19.918 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
06-12 13:22:19.937 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
06-12 13:22:19.938 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
06-12 13:22:19.938 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
06-12 13:22:19.944 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
06-12 13:22:19.954 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
06-12 13:22:19.957 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
06-12 13:22:19.960 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
06-12 13:22:19.961 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
06-12 13:22:19.967 4142 4169 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.reactnativenavigation.views.managers.SharedElementTransitionManager
06-12 13:22:19.969 1988 2142 E Surface : getSlotFromBufferLocked: unknown buffer: 0xa1a1c590
06-12 13:22:20.022 4142 4169 W unknown:React: Initializing React Xplat Bridge.
06-12 13:22:20.024 4142 4169 W unknown:React: Initializing React Xplat Bridge before initializeBridge
06-12 13:22:20.025 4142 4169 W unknown:React: Initializing React Xplat Bridge after initializeBridge
06-12 13:22:20.054 1618 1637 I ActivityManager: Displayed com.my.testapp/.MainActivity: +1s331ms
06-12 13:22:20.068 1618 2223 W AppOps : Finishing op nesting under-run: uid 10061 pkg com.my.testapp code 24 time=0 duration=0 nesting=0
06-12 13:22:20.080 4142 4173 D ReactNativeNotifs: Native module init
06-12 13:22:20.083 4142 4142 W unknown:React: Packager connection already open, nooping.
06-12 13:22:20.083 4142 4142 W unknown:React: Inspector connection already open, nooping.
06-12 13:22:20.117 4142 4175 I ReactNativeNotifs: App initialized => asking for new token
06-12 13:22:20.125 4142 4175 E AndroidRuntime: FATAL EXCEPTION: IntentService[GcmInstanceIdRefreshHandlerService]
06-12 13:22:20.125 4142 4175 E AndroidRuntime: Process: com.my.testapp, PID: 4142
06-12 13:22:20.125 4142 4175 E AndroidRuntime: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw' appears in /data/app/com.my.testapp-1/base.apk)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.google.android.gms.iid.zzd.zzeK(Unknown Source)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmToken.getNewToken(GcmToken.java:88)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmToken.refreshToken(GcmToken.java:77)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmToken.onAppReady(GcmToken.java:66)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at com.wix.reactnativenotifications.gcm.GcmInstanceIdRefreshHandlerService.onHandleIntent(GcmInstanceIdRefreshHandlerService.java:23)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-12 13:22:20.125 4142 4175 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)
06-12 13:22:20.145 1618 3096 W ActivityManager: Force finishing activity com.my.testapp/.MainActivity
06-12 13:22:20.214 1260 2024 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x333 imply creation of host color buffer
06-12 13:22:20.221 1618 3096 D : HostConnection::get() New Host Connection established 0x9b03f940, tid 3096
06-12 13:22:20.245 1260 1260 E EGL_emulation: tid 1260: eglCreateSyncKHR(1660): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-12 13:22:20.345 4142 4152 I art : Background sticky concurrent mark sweep GC freed 17992(1015KB) AllocSpace objects, 4(148KB) LOS objects, 19% free, 3MB/3MB, paused 17.220ms total 85.405ms
06-12 13:22:20.377 1618 3096 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
06-12 13:22:20.387 1618 1618 W art : Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=0 for 225ms
06-12 13:22:20.475 1618 1628 I art : Background partial concurrent mark sweep GC freed 15099(976KB) AllocSpace objects, 3(60KB) LOS objects, 33% free, 7MB/11MB, paused 1.715ms total 149.844ms
06-12 13:22:20.510 1618 1637 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
06-12 13:22:20.642 1618 3386 I OpenGLRenderer: Initialized EGL, version 1.4
06-12 13:22:20.710 1260 2003 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:20.735 1260 2024 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:20.743 1260 2024 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:20.758 1260 2003 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:20.759 1260 2024 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:20.761 1260 2003 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
06-12 13:22:20.770 1618 1949 I AccountManagerService: getTypesVisibleToCaller: isPermitted? true
06-12 13:22:20.892 4142 4161 E Surface : getSlotFromBufferLocked: unknown buffer: 0xb4054a70
06-12 13:22:25.878 2370 4180 W PlatformStatsUtil: Could not retrieve Usage & Diagnostics setting. Giving up.
I've noticed that @lodev09 has public List<ReactPackage> createAdditionalReactPackages() {
in his MainApplication.java
, but I can't seem to find any documentation around that - nor can I work out which packages need to be there and which need to be in protected List<ReactPackage> getPackages() {
.
from react-native-notifications.
@d4vidi I'm assuming based on that stack trace that it's to do with FATAL EXCEPTION: IntentService[GcmInstanceIdRefreshHandlerService]
- is this some sort of missing permission issue similar to what you'd get with iOS?
from react-native-notifications.
@lodev09 @d4vidi I have setup a demo app using both packages - this time I am getting the following:
/Users/chrisedwards/Apps/ReactNative/NotificationNavigation/android/app/src/main/java/com/notificationnavigation/MainApplication.java:20: error: MainApplication is not abstract and does not override abstract method getPushNotification(Context,Bundle,AppLifecycleFacade,AppLaunchHelper) in INotificationsApplication
public class MainApplication extends NavigationApplication implements INotificationsApplication {
^
/Users/chrisedwards/Apps/ReactNative/NotificationNavigation/android/app/src/main/java/com/notificationnavigation/MainApplication.java:40: error: method does not override or implement a method from a supertype
@Override
^
2 errors
:app:compileDebugJavaWithJavac FAILED
Can someone maybe take a look at the demo app and see if they can get it to boot please? A pull with the required changes would be awesome 🙂
from react-native-notifications.
@chrise86 you signature of getPushNotification
is wrong. Should be:
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade facade, AppLaunchHelper defaultAppLaunchHelper)
from react-native-notifications.
@d4vidi holy shit... that worked! Although, I had that in my original project, and changed it after seeing @lodev09's implementation :(
So it seems we don't need to do any of the google-services
related setup from the Google / Firebase docs then?
from react-native-notifications.
@chrise86 You still need to follow their guide. You would need the google-services.json
file and some firebase key configuration, etc.
I skipped the build.gradle
config though (I think this package is already adding those definitions internally or something)
from react-native-notifications.
True, we add everything but the senderId
- which you should add once its made available to you (i.e. when completing the process with google).
from react-native-notifications.
How did you guys integrate it with RN Nav? I'm struggling to find a good place to add the listeners/deep nav handlers.
I have a notification that needs to link to a specific page and I've found it awkward/buggy to integrate- I'd appreciate some guidance if you've done this! :)
Thanks
from react-native-notifications.
@tylerjbainbridge if you're using the latest V2 of RNN, I think they're still working on the handleDeepLink
API which you'll use to open specific screens.
from react-native-notifications.
Related Issues (20)
- "$" getting copied HOT 1
- Code that setting NotificationChannel sound on Android might lead unexpected consequences HOT 1
- Application does not trigger registerNotificationOpened when it is closed, only when it is in the background. HOT 1
- I can't get notifications to open my app HOT 1
- How to undo `Notifications.registerRemoteNotifications()` ? HOT 3
- Minification failure with R8: Compilation failed for ReactAppLifecycleFacade$1 in react-native-notifications
- Not receiving any notification on iOS release mode only HOT 1
- Huawei push notification in library
- dexOptions is obsolete
- Feature request: add support for iOS simulator push notifications HOT 3
- Does FCM work with this package in iOS? HOT 4
- Handle callback when notification in background / terminate app HOT 3
- When I click on the notification on my android app, entire app reloads HOT 4
- Question - is there support for the new RN architecture? HOT 1
- Suggestion - documentation update HOT 1
- Feature request: support for dynamic Live Activities on IOS
- What about the wiki for integration with react notification?
- registerRemoteNotificationsRegistrationDenied being called even when "Allowed" clicked
- is it possible to send local notification when App is closed
- [Question]: Grouping on iOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-notifications.