Closed yangzhipeng-xx closed 3 weeks ago
Hello @yangzhipeng-xx thank you for reaching out. Could you please share codepush logs so i can further assist you? Take a look here how to enable logs for IOS app.
Hi @DordeDimitrijev I use 'code-push-server' and set up a local server to work with 'code-push-cli'
terminal
BUNDLE ./index.js
LOG Running "AwesomeProject" with {"rootTag":11,"initialProps":{"concurrentRoot":false}}
LOG 开始检查更新
LOG codePushStatusDidChange is:5
LOG [CodePush] Reporting CodePush update success (v2)
LOG codePushStatusDidChange is:0
info.plist
<key>CodePushDeploymentKey</key>
<string>d5QmUSkavUtdK1NzaB7a6gRv2dxE4ksvOXqog</string>
<key>CodePushServerURL</key>
<string>http://10.51.126.168:3000/</string>
AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <CodePush/CodePush.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"AwesomeProject";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self bundleURL];
}
- (NSURL *)bundleURL
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
return [CodePush bundleURL];
#endif
}
@end
I see that you are using forked repos of code-push-server and code-push-cli, so we can't guarantee it will work properly. I suggest that you use this code-push repo with appcenter or you can build your own standalone code-push-server from official repo.
I've fixed the problem and now update the code page on the server after reboot. But now I have a new problem. When I open the app for the second time, it goes back to the page before the update. How can I solve this problem?
Is this occuring with offical code-push and official code-push-server or appcenter, If so please share some logs.
@yangzhipeng-xx to keep the code-push persists, make sure to run codePush.notifyAppReady() after installing the new bundle.
Closing due inactivity.
@yangzhipeng-xx How did you solve this problem can you share i am having the same problem
Hello @nguyenductoan1995 thank you for reaching out. Are you using custom code-push server, if so please check the comment posted for reference.
I see that you are using forked repos of code-push-server and code-push-cli, so we can't guarantee it will work properly. I suggest that you use this code-push repo with appcenter or you can build your own standalone code-push-server from official repo.
Steps to Reproduce
On ios, When I clicked Update Now, the update was applied and then restarted, but the page did not change after restart.