CodesFirst / new_version_plus

Check if your user has the most recent version of your Flutter app.
BSD 3-Clause "New" or "Revised" License
30 stars 71 forks source link

debugPrint(status.releaseNotes); Printing null #12

Closed abhinavsinghring closed 1 year ago

abhinavsinghring commented 1 year ago

  void initState() {
    super.initState();
    _createFolderInAppDocDir("PaperBook");
    final newVersion = NewVersionPlus(
      androidId: 'org.telegram.messenger',
    );

    Timer(const Duration(microseconds: 800), () {
      checkNewVersion(newVersion);
    });

  }

  void checkNewVersion(NewVersionPlus newVersion) async {
      final status = await newVersion.getVersionStatus();
      if (status !=null) {
        if (status.canUpdate) {
          debugPrint(status.releaseNotes);
          debugPrint(status.appStoreLink);
          debugPrint(status.localVersion);
          debugPrint(status.storeVersion);
          debugPrint(status.canUpdate.toString());
          showDialog(
            context: context, 
            builder: (BuildContext context) {
              return UpdateDialog(
                description: status.releaseNotes ?? "No Information available.", 
                appLink: status.appStoreLink, 
                allowDismissal: true,
                version: status.storeVersion,);
            }
            );
        }
      }
  }
pewiher commented 1 year ago

currently does not return the release of the application, we are working on a new version that supports this behavior.

pewiher commented 1 year ago

new version: https://pub.dev/packages/new_version_plus

abhinavsinghring commented 1 year ago

Printing something like this

Snapchat is a fast and fun way to share the moment with your friends and family 👻\u003cbr\u003e\u003cbr\u003eSNAP\u003cbr\u003e• Snapchat opens right to the Camera — just tap to take a photo, or press and hold for video.\u003cbr\u003e• Express yourself with Lenses, Filters, Bitmoji and more!\u003cbr\u003e• Try out new Lenses daily created by the Snapchat community!\u003cbr\u003e\u003cbr\u003eCHAT\u003cbr\u003e• Stay in touch with friends through live messaging, or share your day with Group Stories.\u003cbr\u003e• Video Chat with up to 16 friends at once — you can even use Lenses and Filters when chatting!\u003cbr\u003e• Express yourself with Friendmojis — exclusive Bitmoji made just for you and a friend.\u003cbr\u003e\u003cbr\u003eSTORIES\u003cbr\u003e• Watch friends\u0026#39; Stories to see their day unfold.\u003cbr\u003e• See Stories from the Snapchat community that are based on your interests.\u003cbr\u003e• Discover breaking news and exclusive Original Shows.\u003cbr\u003e\u003

pewiher commented 1 year ago

It is correct, because the country code is in English, now a variable has been added to support the country code that you want, the version is 0.0.6

new version: https://pub.dev/packages/new_version_plus,

pewiher commented 1 year ago

final str = releaseNotes?.replaceAll("\<(.)?\>(.)\</\1\>", "");

pewiher commented 1 year ago

final expRemoveSc = RegExp(r"\u003c[A-Za-z]{1,10}\u003e", multiLine: true, caseSensitive: true); releaseNotes?.replaceAll(expRemoveSc, '')

this was added in version 0.0.7