Awn Ali
Awn Ali

Reputation: 1379

Change code push deployment key React native

While integrating code-push in my react-native app using code-push tutorial, i ran following command:

react-native link react-native-code-push

It asked for deployment keys then, which i pasted but now i want to change those keys.

I tried to unlink with the following command but its not working,

react-native unlink react-native-code-push

Can someone please guid me, as i'm new to both react-native and code push?

Upvotes: 0

Views: 7151

Answers (2)

Max Mironov
Max Mironov

Reputation: 121

So basically deployment keys can be stored in different locations and it depends upon how you have configured the application.

You can always find what is the location of the deployment key the following way:

1) For Android it is injected in MainApplication.java file -> getPackages method (the 1st parameter for CodePush class constructor). By default it should be R.string.reactNativeCodePush_androidDeploymentKey which points exactly to strings.xml file. You can override this if needed and store deployment key in arbitrary place or simply hard-code it here (though it is not recommended).

2) For iOS the default place to store deployment key is Info.plist file located in iOS folder of the application (entry named CodePushDeploymentKey). Later it is extracted by the app in native module in CodePushConfig.m class.

Upvotes: 1

Awn Ali
Awn Ali

Reputation: 1379

For IOS:

file:

list.info

key:

CodePushDeploymentKey

For Android:

file:

strings.xml

key:

reactNativeCodePush_androidDeploymentKey

update values of these keys and it will work :)

Upvotes: 4

Related Questions