cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Local notification do not appear once InAppBrowser opened up in Ionic

Open mukeshgupta opened this issue 5 years ago • 1 comments

WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue. I am working on ionic ios project and testing on iphone 6s. Local notification appears on iphone. After writing code of InAppBrowser and executing this.localNotifications.schedule after this.iab.create , notification do not appears on iphone.

Your Environment

  • Plugin version: "dependencies": { "@angular/common": "~8.1.2", "@angular/compiler": "~8.1.2", "@angular/core": "~8.1.2", "@angular/forms": "~8.1.2", "@angular/platform-browser": "~8.1.2", "@angular/platform-browser-dynamic": "~8.1.2", "@angular/router": "~8.1.2", "@ionic-native/core": "^5.0.0", "@ionic-native/firebase": "^5.15.0", "@ionic-native/in-app-browser": "^5.15.0", "@ionic-native/local-notifications": "^5.15.0", "@ionic-native/splash-screen": "^5.0.0", "@ionic-native/status-bar": "^5.0.0", "@ionic/angular": "^4.7.1", "cordova-ios": "^5.0.1", "cordova-plugin-badge": "^0.8.8", "cordova-plugin-firebase": "^2.0.5", "cordova-plugin-inappbrowser": "^3.1.0", "cordova-plugin-local-notification": "^0.9.0-beta.2", "core-js": "^2.5.4", "rxjs": "~6.5.1", "rxjs-compat": "^6.5.3", "tslib": "^1.9.0", "zone.js": "~0.9.1" },

  • Platform: IONIC - Mac os

  • OS version: Mac machine IOS - 10.14.6 Iphone 6s - Software version 13.1

  • Device manufacturer / model: Iphone 6s

  • Cordova version (cordova -v): "cordova-ios": "^5.0.1", "cordova-plugin-badge": "^0.8.8", "cordova-plugin-firebase": "^2.0.5", "cordova-plugin-inappbrowser": "^3.1.0", "cordova-plugin-local-notification": "^0.9.0-beta.2",

  • Cordova platform version (cordova platform ls):

  • Plugin config

  • Ionic Version (if using Ionic) "@ionic-native/core": "^5.0.0",

Expected Behavior

I have written local notification hard code without InAppBrowser code and it appeared properly

this.localNotifications.schedule({id:11, title: 'My first notification before browser',
        text: 'Thats pretty easy...',
        foreground: true});

Now I have added InAppBrowser code and moved local notification code after that. Now local notification do not appear and InAppBrowser shows google.com page.

const browser = this.iab.create('https://google.com','_blank',
        {
          location: "no", allowInlineMediaPlayback:"yes", disallowoverscroll: "yes",
          fullscreen: "yes", hardwareback: "yes"
        });
this.localNotifications.schedule({id:11, title: 'My first notification before browser',
        text: 'Thats pretty easy...',
        foreground: true});

Tell us what should happen

Actual Behavior

It should show local notification after code run InAppBrowser . Tell us what happens instead

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

  1. const browser = this.iab.create('https://google.com','_blank', { location: "no", allowInlineMediaPlayback:"yes", disallowoverscroll: "yes", fullscreen: "yes", hardwareback: "yes" });
  2. this.localNotifications.schedule({id:11, title: 'My first notification before browser', text: 'Thats pretty easy...', foreground: true});
  3. Run code and Local notification do not appear
  4. If you comment out step 1 code and run code then it shows local notification.

Context

What were you trying to do?

Debug logs

2019-10-11 11:11:34.967738+0530 pincbook[1022:44603] THREAD WARNING: ['LocalNotification'] took '2733.921143' ms. Plugin should use a background thread.

Main Thread Checker: UI API called on a background thread: -[UIApplication registerForRemoteNotifications] PID: 1022, TID: 44763, Thread name: (none), Queue name: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out, QoS: 0 Backtrace: 4 pincbook 0x0000000100048a40 __34-[FirebasePlugin grantPermission:]_block_invoke + 132 5 libdispatch.dylib 0x0000000100971828 _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x0000000100972c04 _dispatch_client_callout + 16 7 libdispatch.dylib 0x0000000100979b74 _dispatch_lane_serial_drain + 744 8 libdispatch.dylib 0x000000010097a744 _dispatch_lane_invoke + 500 9 libdispatch.dylib 0x0000000100985ae4 _dispatch_workloop_worker_thread + 1324 10 libsystem_pthread.dylib 0x00000001908fdfa4 _pthread_wqthread + 276 11 libsystem_pthread.dylib 0x0000000190900ae0 start_wqthread + 8 2019-10-11 11:11:36.067739+0530 pincbook[1022:44763] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication registerForRemoteNotifications] PID: 1022, TID: 44763, Thread name: (none), Queue name: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out, QoS: 0 Backtrace: 4 pincbook 0x0000000100048a40 __34-[FirebasePlugin grantPermission:]_block_invoke + 132 5 libdispatch.dylib 0x0000000100971828 _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x0000000100972c04 _dispatch_client_callout + 16 7 libdispatch.dylib 0x0000000100979b74 _dispatch_lane_serial_drain + 744 8 libdispatch.dylib 0x000000010097a744 _dispatch_lane_invoke + 500 9 libdispatch.dylib 0x0000000100985ae4 _dispatch_workloop_worker_thread + 1324 10 libsystem_pthread.dylib 0x00000001908fdfa4 _pthread_wqthread + 276 11 libsystem_pthread.dylib 2019-10-11 11:11:36.081335+0530 pincbook[1022:44603] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x100c47e40>. 0x0000000190900ae0 start_wqthread + 8 Include iOS / Android logs

  • ios XCode logs
  • Android: $ adb logcat

mukeshgupta avatar Oct 11 '19 05:10 mukeshgupta

I'm wondering really hard why nobody even acknowledge the existence of this question from 2019, I'm having the same issue right now...

Loschcode avatar Feb 01 '21 20:02 Loschcode