Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert user to new version in app store #369

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

robbiemccorkell
Copy link
Contributor

This PR uses the package react-native-version-check to check if there is a newer version of the app in a respective app store and alerts the user.

The package seems to compare the latest app store version to that found in Info.plist in IOS, and the versionName defined in Android. I'm not very familiar with how this works but I assume we set these numbers via fastlane at build time.

To manually test this on each platform we had to:

IOS:

  • Change the version number in Info.plist to something lower than that listed in the app store.

Android:

  • Change the run-android command in package.json to org.prideinlondon.festival instead of org.prideinlondon.festival.dev to match that app store app Id.
  • In android/app/build.gradle change productFlavors.dev.applicationId to org.prideinlondon.festival.

I'm sure there's a better way of doing this, but those are the steps we took.

If everyone thinks this is feasible we can run it past UX to see what the best way of alerting the user is, and to consider a "Remind me later" feature.

Pre-flight check-list

Before raising a pull request

  • Documentation
  • Unit tests

Pre-merge check-list

  • Link to Trello ticket/GitHub issue (If applicable)
  • Any risky areas identified
  • Test plan provided
  • Tester approved

Tester check-list

  • Tested on multiple devices / OS versions (Test on the physical device(s) you have access to, otherwise use BrowserStack):

    • Galaxy S8 (Android 7.0/8.0)
    • Galaxy S7 (Android 6.0)
    • iPhone X (iOS 11.x)
    • iPhone 8 (11.x)
    • iPhone 7 (iOS 10.x)

    Optional:

    • Google Pixel 2
    • Galaxy S8 Plus
    • Galaxy S7 Edge
    • Galaxy S6
    • iPhone 7+
    • iPhone 6

Accessibility Testing (If applicable)

  • Text-to-Voice (Android: Voice Assistant / iOS: Speak Selection)
  • Large Text (=<200%)
  • Landscape Screen orientation

Weak connection testing (If applicable)

  • Airplane mode
  • 2G/3G Network Settings

@lani-s
Copy link
Contributor

lani-s commented Jun 4, 2018

@clmntnbrn @stevecottle would be good to get some UXD input into how we might surface this to users without annoying them :)

@robbiemccorkell
Copy link
Contributor Author

@markholland When you next have the chance it would be great to get your opinion on this. Want to make sure that it fits with how we are managing version numbers.

@markholland
Copy link
Collaborator

This is fine as it uses the public version numbers. We'd only have to worry if it was using the Android versionCode or iOS Build Number.

@robbiemccorkell
Copy link
Contributor Author

I've added "Ask me later" functionality and productionised the code. In it's current state this could go out to production if we really want it and there's always the option to make it prettier later.

If a user presses "Ask me later" the app will wait until the start of the next day to notify the user when they next open the app.

screen shot 2018-06-09 at 17 24 48

screen shot 2018-06-09 at 17 24 49

@robbiemccorkell robbiemccorkell changed the title Spike: Alert user to new version in app store Alert user to new version in app store Jun 9, 2018
@robbiemccorkell
Copy link
Contributor Author

Could definitely do with a review of the copy in the dialog too

}

handleAppStoreAlert = () =>
Alert.alert(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work if the app was send to the backround while the update check was running?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick test by throwing a delay into the code. It looks like when the app is in the background, nothing happens on the system level, but when you open the app again the dialog is there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that sounds good 👍

import * as storage from "../integrations/storage";
import * as date from "../lib/date";

const nextTick = () => new Promise(resolve => setTimeout(resolve, 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we can use jest.runAllTicks() instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about this, but I tried it out and it gave me a weird warning and didn't work.

I've simplified it a little to use process.nextTick though, since I only just found out about this too.

Copy link
Contributor

@RGBboy RGBboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one comment around refactoring the notifyError action creator into a more generic error action type and adding a bugsnag middleware instead. Once that is sorted I'll happily give this a 👍

export const notifyReporter = (error: Error) => (
_: Dispatch<>,
__: () => State,
errorReporter: Client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to create a top level action, like our INIT action that is just called ERROR with an error property to hold the error data. Then to notify bugsnag, we create a bugsnag middleware that listens for this action. This would mean that we don't need to instantiate the thunk middleware with extra arguments and complicate our action creators.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, makes sense. Sorry it took me so long to get back to this, I'll fix this up on Saturday

@markholland
Copy link
Collaborator

Is it possible to only show this for minor updates rather than patches? Because of our current release process, if there's a bug on one platform we still have to release a patch update for both.

@robbiemccorkell
Copy link
Contributor Author

@markholland Yea I think you can specify a depth to the library. That's a good point, it might be a bit too chatty on on patch versions.

I'll have a go at limiting to major and minor only.

@stevecottle
Copy link

This looks fine, I have a couple of questions about the details:

How often will this be triggered?
What happens when I tap 'OK'?

Could the copy read:
Update app?
A new version of this app is available from the store. Would you like to update now?
[ Ask me tomorrow ] [ Disagree ] [ Agree ]

Ref:
https://material.io/design/components/dialogs.html#anatomy

I can't find an iOS version of this doc^ for guidance of button order. Has anyone copme across anything similar?

@serdemli
Copy link

@stevecottle
The iOS guide on Alerts is here: https://developer.apple.com/design/human-interface-guidelines/ios/views/alerts/

We should be able to change the CTA text- and I agree it should be clearer than just "OK" - "Update now" sounds good to me. That CTA would take you to the app store or google play, where you can update the app.

"Ask me tomorrow" could be a weird one, as from what I understand, you can customise when you want to get reminders on Android. Ask me later is the generic and most common way most apps go about it. Rather than having to build something different for Android- if that's the case - we should keep both the same and keep it consistent with other apps out there.

So.. @robbiemccorkell sounds like this one's good to go, with the change from OK to Update now, if possible :)

@frigus02
Copy link
Contributor

I can have a look at changing the text today and limit to major and minor versions only.

@frigus02
Copy link
Contributor

@stevecottle: It will be triggered on every app start, but not when the app is already running and just brought to the foreground.

@serdemli Android won't be an issue. Android restricts usage of exact timers and users can choose to disable/deley notifications. But we use neither of those in this PR.

@frigus02
Copy link
Contributor

We discussed in stand-up, that this might not be needed anymore since won't get the notification for the parade update anyway. So I'll let @robbiemccorkell finish this 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants