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

ios not replace file.help me ! #941

Closed
wuyunqiang opened this issue Jul 28, 2017 · 7 comments
Closed

ios not replace file.help me ! #941

wuyunqiang opened this issue Jul 28, 2017 · 7 comments

Comments

@wuyunqiang
Copy link

Description

1:yarn add react-native-code-push
2:react-native link react-native-code-push
3:change key to info.plist
4:write
CodePush.sync({
updateDialog: {
optionalIgnoreButtonLabel: '稍后',
optionalInstallButtonLabel: '后台更新',
optionalUpdateMessage: '钱包金融有新版本了,是否更新?',
title: '更新提示'
},
installMode: CodePush.InstallMode.IMMEDIATE
});
5:react-native run-ios and change A->B someting.
6:code-push release-react fincios ios --t 1.0.0 --d Production --des “加上banner” -m false
7:i rollback before. B->A someting
8:I can get updateDialog and choose optionalInstallButtonLabel.
then refresh,but not change.

Additional Information

"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
"react-native-code-push": "^4.1.0-beta",

  • iOS version:10.3
  • Does this reproduce on a debug build or release build? debug build
  • Does this reproduce on a simulator? YES
@wuyunqiang
Copy link
Author

I use codepush to Android and it ok.

@sergey-akhalkov
Copy link
Contributor

Hi @wuyunqiang, I can see that you are testing CodePush updates in Debug mode, but you shouldn't do so - please take a look at the note from the official docs:

NOTE: CodePush updates should be tested in modes other than Debug mode. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply.

That is the most possible reason why you couldn't see any changes after refresh. Please let me know if you have any questions or considerations.

@wuyunqiang
Copy link
Author

In Debug mode,can I setting someting to stop RN load JS bundle generated by packager?
like android setting ip:port to some string. ios can do that ?
if release is ok?
@sergey-akhalkov

@sergey-akhalkov
Copy link
Contributor

@wuyunqiang, sure, it's possible to test updates in debug mode, to do so you need:

  1. Modify the AppDelegate.m to force the JSCode location to be "remote". (This is already done for you if you are using the example app)
jsCodeLocation = [CodePush bundleURL];

//#ifdef DEBUG
////  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
//  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios"fallbackResource:nil];
//#else
//  jsCodeLocation = [CodePush bundleURL];
//#endif
//
  1. Comment around lines 17-20 in node_modules/react-native/scripts/react-native-code.sh the lines:
    # if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then
      # echo "Skipping bundling for Simulator platform"
      # exit 0;
    # fi

Please let me know if it helps.

@wuyunqiang
Copy link
Author

change it after jsCodeLocation = [CodePush bundleURL];
I need to run-ios again?

@sergey-akhalkov
Copy link
Contributor

@wuyunqiang, yeah, you need to perform run-ios ones just after the changes you have made in AppDelegate.m

@wuyunqiang
Copy link
Author

ok thx.

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

No branches or pull requests

2 participants