@@ -110,15 +110,17 @@ function sync(options = {}) {
110
110
ignoreFailedUpdates : true ,
111
111
112
112
mandatoryContinueButtonLabel : "Continue" ,
113
- mandatoryUpdateMessage : "An update is available that must be installed" ,
113
+ mandatoryUpdateMessage : "An update is available that must be installed. " ,
114
114
115
115
optionalIgnoreButtonLabel : "Ignore" ,
116
116
optionalInstallButtonLabel : "Install" ,
117
117
optionalUpdateMessage : "An update is available. Would you like to install it?" ,
118
118
119
- updateTitle : "Update available" ,
120
119
rollbackTimeout : 0 ,
121
120
121
+ updateTitle : "Update available" ,
122
+ useReleaseDescription : false ,
123
+
122
124
...options
123
125
} ;
124
126
@@ -136,7 +138,7 @@ function sync(options = {}) {
136
138
onPress : ( ) => {
137
139
remotePackage . download ( )
138
140
. then ( ( localPackage ) => {
139
- resolve ( CodePush . SyncStatus . APPLY_SUCCESS ) ;
141
+ resolve ( CodePush . SyncStatus . UPDATE_DOWNLOADED ) ;
140
142
localPackage . apply ( syncOptions . rollbackTimeout ) ;
141
143
} , reject ) ;
142
144
}
@@ -158,7 +160,13 @@ function sync(options = {}) {
158
160
} ) ;
159
161
}
160
162
161
- AlertIOS . alert ( syncOptions . updateTitle , message || remotePackage . description , dialogButtons ) ;
163
+ // If the update has a description, and the developer
164
+ // explicitly chose to display it, then set that as the message
165
+ if ( syncOptions . useReleaseDescription && remotePackage . description ) {
166
+ message = remotePackage . description ;
167
+ }
168
+
169
+ AlertIOS . alert ( syncOptions . updateTitle , message , dialogButtons ) ;
162
170
}
163
171
} , reject ) ;
164
172
} ) ;
@@ -174,7 +182,7 @@ var CodePush = {
174
182
SyncStatus : {
175
183
NO_UPDATE_AVAILABLE : 0 , // The running app is up-to-date
176
184
UPDATE_IGNORED : 1 , // The app had an optional update and the end-user chose to ignore it
177
- APPLY_SUCCESS : 2 // The app had an optional/mandatory update that was successfully downloaded and is about to be applied
185
+ UPDATE_DOWNLOADED : 2 // The app had an optional/mandatory update that was successfully downloaded and is about to be applied
178
186
}
179
187
} ;
180
188
0 commit comments