larryaasen / upgrader

A Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
MIT License
531 stars 262 forks source link

Issues With Update Now Button #300

Open raphaeldivine3028 opened 1 year ago

raphaeldivine3028 commented 1 year ago

Firstly, thank you so much for the efforts put into this package. Much appreciated.

This works for me but for some android version it won't work.

When the Update Now button is clicked, it's expected to redirect the user to playstore, but it won't.

This is my log:

I/flutter (20089): upgrader: instantiated.
I/flutter (20089): upgrader: build UpgradeAlert
I/flutter (20089): upgrader: initialize called
I/flutter (20089): upgrader: initializing
I/flutter (20089): upgrader: languageCode: en
I/flutter (20089): upgrader: default operatingSystem: android CC9-H626FGH-P-210701V471
I/flutter (20089): upgrader: operatingSystem: android
I/flutter (20089): upgrader: isAndroid: true, isIOS: false, isLinux: false, isMacOS: false, isWindows: false, isFuchsia: false, isWeb: false
I/flutter (20089): upgrader: package info packageName: com.allschool.littexts
I/flutter (20089): upgrader: package info appName: LitTexts
I/flutter (20089): upgrader: package info version: 1.2.6
I/flutter (20089): upgrader: countryCode: US
I/flutter (20089): upgrader: languageCode: en
I/flutter (20089): upgrader: lookupById url: https://play.google.com/store/apps/details?id=com.allschool.littexts&gl=US&hl=en&_cb=1687429774284257
I/flutter (20089): upgrader: blocked: false
I/flutter (20089): upgrader: debugDisplayAlways: true
I/flutter (20089): upgrader: debugDisplayOnce: false
I/flutter (20089): upgrader: hasAlerted: false
I/flutter (20089): upgrader: shouldDisplayUpgrade: true
I/flutter (20089): upgrader: shouldDisplayReleaseNotes: false
I/flutter (20089): upgrader: showDialog title: Update Available!
I/flutter (20089): upgrader: showDialog message: We want you to keep enjoying this app, that's why we have updated it to something more awesome!
I/flutter (20089): upgrader: showDialog releaseNotes: null
I/flutter (20089): upgrader: button tapped: update now
I/flutter (20089): upgrader: launching: https://play.google.com/store/apps/details?id=com.allschool.littexts&gl=US&hl=en&_cb=1687429783486462
I/flutter (20089): upgrader: launch to app store failed: PlatformException(java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=https://play.google.com/... cmp=team.opay.pay.merchant.service/com.opay.webview.WebFoundationActivity (has extras) } from ProcessRecord{fa90e39 20089:com.allschool.littexts/u0a726} (pid=20089, uid=10726) not exported from uid 10140, SecurityException, Cause: android.os.RemoteException: Remote stack trace:

PS: I tested it with android 8 and it worked. Also, I have internet permissions in my android manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.allschool.littexts">
    <uses-permission android:name="android.permission.INTERNET" />
   <application
        android:label="LitTexts"
....

Also, these are my UI codes:

body: UpgradeAlert(
        upgrader: Upgrader(
          dialogStyle: UpgradeDialogStyle.cupertino,
          messages: MyUpgraderMessages(),
          showReleaseNotes: false,
          debugDisplayAlways: true,
          countryCode: "US",
          debugLogging: true,
        ),
        child: GetBuilder<MyDrawerController>(
          builder: (_) => ZoomDrawer(
// other codes
Marco4763 commented 1 year ago

Hello @raphaeldivine3028 raphaeldivine3028, from what you described and with the log you passed, I don't believe it's a Lib problem, I suggest these steps: 1 - As your phone appears to be a Tecno, try to check if your Google Play Services is up to date 2 - Access your AndroidManifest and change your android:exported="false" to true like this:

< activity
      ...
      android:exported="true">

Then just try again. Please reply if this resolves the issue.

raphaeldivine3028 commented 1 year ago
  1. Yes my Google Play Services is up to date.
  2. android exported is set to true before now.

The issue still persists.

larryaasen commented 8 months ago

@raphaeldivine3028 Is this still an issue for you? I don't think this is an upgrader issue as this works well in many Android apps.