You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,7 +15,7 @@ HUAWEI Dynamic Tag Manager (DTM) is a dynamic tag management system. With DTM, i
15
15
16
16
The React Native Plugin enables communication between HUAWEI DTM SDK and React Native platform. HUAWEI DTM offers you a range of preset DTM models so you can gain a deeper insight in.
-[Operations on the Server](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/operation-server-overview-0000001077378810?ha_source=hms1)
If you have questions about how to use HMS samples, try the following options:
38
39
-[Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services) is the best place for any programming questions. Be sure to tag your question with
39
40
**huawei-mobile-services**.
40
41
-[Github](https://github.com/HMS-Core/hms-react-native-plugin) is the official repository for these plugins, You can open an issue or submit your ideas.
41
-
-[Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001) HMS Core Module is great for general questions, or seeking recommendations and opinions.
42
-
-[Huawei Developer Docs](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin) is place to official documentation for all HMS Core Kits, you can find detailed documentations in there.
42
+
-[Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001&ha_source=hms1) HMS Core Module is great for general questions, or seeking recommendations and opinions.
43
+
-[Huawei Developer Docs](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1) is place to official documentation for all HMS Core Kits, you can find detailed documentations in there.
43
44
44
45
If you run into a bug in our samples, please submit an issue to the [GitHub repository](https://github.com/HMS-Core/hms-react-native-plugin).
This demo project is an example to demonstrate the features of the **Huawei React-Native DTM Kit** Plugin.
17
+
18
+
---
19
+
20
+
## 2. Installation
21
+
22
+
Before you get started, you must register as a HUAWEI developer and complete identity verification on the [HUAWEI Developer](https://developer.huawei.com/consumer/en/?ha_source=hms1) website. For details, please refer to [Register a HUAWEI ID](https://developer.huawei.com/consumer/en/doc/10104?ha_source=hms1).
23
+
24
+
### Creating a Project in AppGallery Connect
25
+
Creating an app in AppGallery Connect is required in order to communicate with the Huawei services. To create an app, perform the following steps:
26
+
27
+
**Step 1.** Set an unique **Application ID** on the app level build gradle file located on **example/android/app/build.gradle**. You should also change the **package names** for the manifest files in the **/example/android/app/src/** directory to match with the Application ID.
28
+
```gradle
29
+
<!-- Other configurations ... -->
30
+
defaultConfig {
31
+
// Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). You may need to change the package name on AndroidManifest.xml and MainActivity.java respectively.
32
+
// The Application ID here should match with the Package Name on the AppGalleryConnect
33
+
applicationId "<Enter_Your_Package_Here>"
34
+
<!-- Other configurations ... -->
35
+
}
36
+
```
37
+
38
+
**Step 2.** Sign in to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html?ha_source=hms1) and select **My projects**.
39
+
40
+
**Step 3.** Select your project from the project list or create a new one by clicking the **Add Project** button.
41
+
42
+
**Step 4.** Go to **Project Setting** > **General information**, and click **Add app**.
43
+
If an app exists in the project and you need to add a new one, expand the app selection area on the top of the page and click **Add app**.
44
+
45
+
**Step 5.** On the **Add app** page, enter the **Application ID** you've defined before as the **Package Name** here, then fill the necessary fields and click **OK**.
46
+
47
+
**Step 6:** Copy the **agconnect-service.json** file to the **android/app** directory of your React Native project.
48
+
49
+
### Configuring the Signing Certificate Fingerprint
50
+
51
+
A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to access an HMS Core (APK) through the HMS SDK. Before using the HMS Core (APK), you must locally generate a signing certificate fingerprint and configure it in the **AppGallery Connect**. You can refer to 3rd and 4th steps of [Generating a Signing Certificate](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html?ha_source=hms1#2) codelab tutorial for the certificate generation. Perform the following steps after you have generated the certificate.
52
+
53
+
**Step 1:** Sign in to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html?ha_source=hms1) and select your project from **My Projects**. Then go to **Project Setting** > **General information**. In the **App information** field, click the icon next to SHA-256 certificate fingerprint, and enter the obtained **SHA-256 certificate fingerprint**.
54
+
55
+
**Step 2:** After completing the configuration, click **OK** to save the changes. (Check mark icon)
56
+
57
+
**Step 3:** Enter the properties of the key you generated to the **build.gradle** file located on **example/android/app/build.gradle**.
58
+
```
59
+
signingConfigs {
60
+
config {
61
+
storeFile file('<keystore_file>')
62
+
keyAlias '<key_alias>'
63
+
keyPassword '<key_password>'
64
+
storePassword '<keystore_password>'
65
+
v1SigningEnabled true
66
+
v2SigningEnabled true
67
+
}
68
+
}
69
+
```
70
+
**Step 4:** Check whether the **agconnect-services.json** file and signature file are placed in **android/app** directory of the React Native project.
71
+
72
+
### Build & Run the project
73
+
74
+
- In *example* folder, run command as follows.
75
+
76
+
```
77
+
npm run i
78
+
```
79
+
80
+
- Run the app by executing following command.
81
+
82
+
```bash
83
+
react-native run-android
84
+
```
85
+
86
+
---
87
+
88
+
## 3. Configuration
89
+
90
+
No.
91
+
92
+
---
93
+
94
+
## 4. Licensing and Terms
95
+
96
+
Huawei React-Native HMS DTM - Demo is licensed under [Apache 2.0 license](LICENCE)
0 commit comments