Android code sample
To check the style and interaction effect of this function in mobile device, download Android code sample, then compile bundle in local Android Studio and install .apk
file in you mobile device. See Get code sample for more information.
iOS code sample
Check for updates
mPaaS automatically connect the release function by calling update check interface to check whether a new version is available. If a new version is available, a update window automatically pop up to remind user for update. User tap Update to start auto update, no other encoding is required. To custom update prompt window, see UI of custom update prompt below.
- (void)checkUpdate
{
UpgradeCheckService *service = [UpgradeCheckService sharedService];
service.delegate = self;
[service checkUpgradeAndShowAlertWith:YES];
}
Note: When you add SDK, the dependency on release service gateway
mPaaS > Targets > MPHttpClient > DTRpcInterface+upgradeComp.m
is automatically added, thus you only need to callcheckUpgradeAndShowAlertWith
method, the release component automatically connect the release service in background.
UI of custom update prompt
You can custom the update prompt by implementing delegate.
# pragma mark UpgradeViewDelegate
- (UIImage *)upgradeViewHeader
{
return [UIImage imageNamed:@"FinancialCloud"];
}
- (void)showProgressHUD:(BOOL)animation
{
self.toast = [APToastView presentToastWithin:self.view withIcon:APToastIconLoading text:nil];
}
- (void)hideProgressHUD:(BOOL)animation
{
[self.toast dismissToast];
}
- (void)showToastViewWith:(NSString *)message duration:(NSTimeInterval)timeInterval
{
[self showAlert:message];
}