You can create an app in AppGallery Connect. Then AppGallery Connect will automatically generate basic configuration information for it.
npm install -g yarn
The following figure shows the result after installation.
Create a React Native project.
npx react-nat***<project name>***ect name>
For example, you can create a project named rndemo by running the following command:
npx react-native init rndemo
If the creation is successful, the following information is displayed.
buildscript {
repositories {
google()
jcenter()
// Make sure that the following line is added.
maven { url 'https://developer.huawei.com/repo/' } // HUAWEI Maven repository
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
// Add the following line.
classpath 'com.huawei.agconnect:agcp:1.5.0.300' // HUAWEI agcp plugin
}
}
allprojects {
repositories {
google()
jcenter()
// Make sure that the following line is added.
maven { url 'https://developer.huawei.com/repo/' } // HUAWEI Maven repository
}
}
apply plugin: 'com.android.application'
// Make sure that the following line is added.
apply plugin: 'com.huawei.agconnect
- (BOOL)Application:(UIApplication *)Application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
// Override the code for customization after app launch.
[AGCInstance startup];
return YES;
}