There's a way to only show the update dialog confirmation if the build is a mandatory one?
Asked
Active
Viewed 1,529 times
1 Answers
4
Witalo Benicio Hi. Yes, it can be done in several ways. But first of all, you have to fetch the build metadata to know if it's mandatory or not. It can be done using getUpdateMetadata(UpdateState.LATEST) - it returns LocalPackage instance with isMandatory flag.
After that you can use:
- sync() method with
{ updateDialog: true }
setting. It's the most flexible solution but requires more code to be implemented. And it requires one very important limitation (form CodePush docs):
To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the updateDialog option when calling sync
- You can implement your own update dialog and handle user actions by yourself. Maybe, this approach is even better, because in this case you don't violate any Apple's policy and can provide an even more flexible solution.
In any case, you have to fetch metadata first and then make a decision. Hope it helps.

styleofspur
- 123
- 2
- 11
-
Thanks @Style Ofspur – WitaloBenicio May 29 '19 at 17:00