deggertsen / react-native-code-push-expo-plugin

A plugin for use with Expo and react-native-code-push
30 stars 6 forks source link

Plugin Android config native not work perfectly #4

Closed trungls1706 closed 1 year ago

trungls1706 commented 1 year ago

Hi @deggertsen Thanks for great plugin I follow your solution download your plugin, place this file into my Expo app directory, and after when i integrate , i check android folder and i found somethings not match with official docs react-native-code-push https://learn.microsoft.com/en-us/appcenter/distribution/codepush/rn-get-started

specifically like this

android/settings.gradle: -- official docs

include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

-- plugin config

include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(["node", "--print", "require.resolve('react-native-code-push/package.json')"].execute(null, rootDir).text.trim(), "../android/app")

android/app/build.gradle -- official docs : add the codepush.gradle file

apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

-- plugin config: missing this file, nothing work

MainApplication.java: add on -- official docs

 ...
@Override
   protected String getJSBundleFile() {
        return CodePush.getJSBundleFile();
    }
 ...

-- plugin config: missing this file, nothing work

strings.xml -- official docs : add on

<resources>
     <string moduleConfig="true" name="CodePushDeploymentKey">DeploymentKey</string>
 </resources>

-- plugin config:

<resources>
    <string name="CodePushDeploymentKey">RuA86BcrPqFFlW0LldlRRRX5Y8I5hdbySlEh1</string>
 </resources>

I must follow official docs , config manual for codePush work perfectly Please help me this case I appreciate your help

deggertsen commented 1 year ago

You will need to make adjustments to this package for things to work. This is not meant to be an install and you're done solution. All of what you mentioned is actually in there, but you will need to make adjustments for your particular case.

Concerning the two you said are missing. I assure you, they are there.

plugin/src/android/buildscriptDependency.ts apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

plugin/src/android/mainApplicationDependency.ts

@Override
   protected String getJSBundleFile() {
        return CodePush.getJSBundleFile();
    }

In my scripts, I'm trying to use code that will get the path automatically from your implementation rather than hard coding the path like the codepush docs ask. You are welcome to change that.

I cannot provide further support at this time so I wish you the best of luck! Hopefully this at least gets you started.