pushandplay / cordova-plugin-apprate

This plugin provide the "rate this app" functionality into your Cordova/Phonegap application
Apache License 2.0
300 stars 190 forks source link

App fails to open app store #311

Open thomashrabe opened 2 years ago

thomashrabe commented 2 years ago

I guess I am missing something in my implementation, I see the promt questions but then when I click yes it fails in the simulator. Is it expected to fail in the simulator?

ionic --version
6.10.1
const appRatePreferences: AppRatePreferences = {
      displayAppName: 'XYZ',
      simpleMode: true,
      usesUntilPrompt: 1,
      storeAppURL: {
        ios: 'XYZ',
        android: 'market://details?id=ZYX'
      },
      customLocale: {
        title: 'Would you mind rating XYZ?',
        message: 'If you like XYZ, please help us spread the word!',
        cancelButtonLabel: 'No, Thanks',
        laterButtonLabel: 'Remind Me Later',
        rateButtonLabel: 'Rate It Now',
        yesButtonLabel: 'Yes!',
        noButtonLabel: 'Nah',
        appRatePromptTitle: 'Do you like using XYZ',
        feedbackPromptTitle: 'If you like XYZ, please help us spread the word!',
      }
    };
    this.appRate.setPreferences(appRatePreferences);
To Native Cordova ->  NativeStorage setItem NativeStorage1918468506 ["options": [counter, {"applicationVersion":"3.0.2","countdown":2}]]
To Native Cordova ->  Notification confirm Notification1918468507 ["options": [If you like our app, please help us spread the word!, Would you mind rating our app?, <__NSArrayM 0x6000035f0960>(
No, Thanks,
Remind Me Later,
Rate It Now
)
]]
2021-07-02 10:42:47.794872-0700 App[7465:71351] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
To Native Cordova ->  NativeStorage setItem NativeStorage1918468508 ["options": [counter, {"applicationVersion":"3.0.2","countdown":2}]]
To Native Cordova ->  AppRate launchiOSReview INVALID ["options": [XYZ, 0]]
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIViewController init]
PID: 7465, TID: 71658, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4   CordovaPlugins                      0x0000000107026714 __29-[CDVAppRate launchAppStore:]_block_invoke + 68
5   libdispatch.dylib                   0x00000001082978ac _dispatch_call_block_and_release + 12
6   libdispatch.dylib                   0x0000000108298a88 _dispatch_client_callout + 8
7   libdispatch.dylib                   0x000000010829af06 _dispatch_queue_override_invoke + 1032
8   libdispatch.dylib                   0x00000001082aa5b6 _dispatch_root_queue_drain + 351
9   libdispatch.dylib                   0x00000001082aaf1b _dispatch_worker_thread2 + 135
10  libsystem_pthread.dylib             0x00007fff5dcd89f7 _pthread_wqthread + 220
11  libsystem_pthread.dylib             0x00007fff5dcd7b77 start_wqthread + 15
2021-07-02 10:42:49.494941-0700 App[7465:71658] [reports] Main Thread Checker: UI API called on a background thread: -[UIViewController init]
PID: 7465, TID: 71658, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4   CordovaPlugins                      0x0000000107026714 __29-[CDVAppRate launchAppStore:]_block_invoke + 68
5   libdispatch.dylib                   0x00000001082978ac _dispatch_call_block_and_release + 12
6   libdispatch.dylib                   0x0000000108298a88 _dispatch_client_callout + 8
7   libdispatch.dylib                   0x000000010829af06 _dispatch_queue_override_invoke + 1032
8   libdispatch.dylib                   0x00000001082aa5b6 _dispatch_root_queue_drain + 351
9   libdispatch.dylib                   0x00000001082aaf1b _dispatch_worker_thread2 + 135
10  libsystem_pthread.dylib             0x00007fff5dcd89f7 _pthread_wqthread + 220
11  libsystem_pthread.dylib             0x00007fff5dcd7b77 start_wqthread + 15
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIViewController presentViewController:animated:completion:]
PID: 7465, TID: 71658, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4   CordovaPlugins                      0x0000000107026806 __29-[CDVAppRate launchAppStore:]_block_invoke + 310
5   libdispatch.dylib                   0x00000001082978ac _dispatch_call_block_and_release + 12
6   libdispatch.dylib                   0x0000000108298a88 _dispatch_client_callout + 8
7   libdispatch.dylib                   0x000000010829af06 _dispatch_queue_override_invoke + 1032
8   libdispatch.dylib                   0x00000001082aa5b6 _dispatch_root_queue_drain + 351
9   libdispatch.dylib                   0x00000001082aaf1b _dispatch_worker_thread2 + 135
10  libsystem_pthread.dylib             0x00007fff5dcd89f7 _pthread_wqthread + 220
11  libsystem_pthread.dylib             0x00007fff5dcd7b77 start_wqthread + 15
2021-07-02 10:42:49.568319-0700 App[7465:71658] [reports] Main Thread Checker: UI API called on a background thread: -[UIViewController presentViewController:animated:completion:]
PID: 7465, TID: 71658, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4   CordovaPlugins                      0x0000000107026806 __29-[CDVAppRate launchAppStore:]_block_invoke + 310
5   libdispatch.dylib                   0x00000001082978ac _dispatch_call_block_and_release + 12
6   libdispatch.dylib                   0x0000000108298a88 _dispatch_client_callout + 8
7   libdispatch.dylib                   0x000000010829af06 _dispatch_queue_override_invoke + 1032
8   libdispatch.dylib                   0x00000001082aa5b6 _dispatch_root_queue_drain + 351
9   libdispatch.dylib                   0x00000001082aaf1b _dispatch_worker_thread2 + 135
10  libsystem_pthread.dylib             0x00007fff5dcd89f7 _pthread_wqthread + 220
11  libsystem_pthread.dylib             0x00007fff5dcd7b77 start_wqthread + 15

@pushandplay

laf1greg commented 2 years ago

Same problem, (I only try with intern Test in play store though). Did you find a fix ?

Finally after reading all the doc :) it finally is working with InAppReview

thomashrabe commented 2 years ago

No, I wrote my own plugin, currently working on getting Android up. iOS works well. Very bare bone implementation. https://github.com/thomashrabe/AppRate I did not bother to get the plugin conflicts resolved over time...

chidav77 commented 1 year ago

Hi, I'm facing the same issue.... tried to use your code here:


const appRatePreferences: AppRatePreferences = {
        displayAppName: 'XYZ',
        simpleMode: true,
        usesUntilPrompt: 1,
        reviewType: {android:AppRateReviewTypeAndroid.InAppReview},
        storeAppURL: {

          android: 'market://details?id=my.package.name'
        },
        customLocale: {
          title: 'Would you mind rating XYZ?',
          message: 'If you like XYZ, please help us spread the word!',
          cancelButtonLabel: 'No, Thanks',
          laterButtonLabel: 'Remind Me Later',
          rateButtonLabel: 'Rate It Now',
          yesButtonLabel: 'Yes!',
          noButtonLabel: 'Nah',
          appRatePromptTitle: 'Do you like using XYZ',
          feedbackPromptTitle: 'If you like XYZ, please help us spread the word!',
        }
      };
      this.appRate.setPreferences(appRatePreferences);

but I always get this error:

ultima-estrazione:9842 Uncaught TypeError: Cannot read properties of undefined (reading 'open')
    at Object.openUrl (ultima-estrazione:9842:28)
    at AppRate.navigateToAppStore (ultima-estrazione:10090:21)
    at promptForStoreRatingWindowButtonClickHandler (ultima-estrazione:9883:17)
    at Object.callbackFromNative (ultima-estrazione:1608:52)
    at <anonymous>:1:9

when the plugin try to open the url or nothing happens if I set InAppReview

I read that @laf1greg make it works... Could you help/share some code? Thanks