Official Content

The purpose of this article is to explain the necessary steps to register an application to use JPush services.

To enable the JPush Notification Provider to send push notifications, you need to register your application in the Jiguang Developer Site to get the credentials required to use JPush services.

Step 1 - Get certificates

Get the certificates for each platform deployed.
Refer to:

Step 2 - Login

Go to Jiguang Developer Site, enter your user credentials and log in.
JPush - Step1 - Login

Step 3 - Create a new app

Select "Create a new application" option on the dashboard.
JPush - Step2 - CreateApp

Enter a name (required) and an icon (optional) for your application.
JPush - Step2 - EnterName

Step 4 - Get the credentials

Once the application is created, you already have the credentials needed to integrate the JPush services in your GeneXus-generated application. These credentials will be set through the environment properties App Key and Master Secret.
JPush - Step3 - Credentials

Step 5 - Configure platforms

Set the platform-specific configurations for Android and Apple in the Application Settings section (check picture above).

Android
You just need to set the application package name:
JPush - Step4 - Android

Apple

  • Upload Production certificate obtained in Step 1
  • Upload Development certificate obtained in Step 1 (optional)
  • Set "Certificate" as the Authentication Method

JPush - Step4 - iOSSet

Once the iOS configuration is set, the application settings will look like the following image:
JPush - Step4 - iOSConfigured

Considerations

The following information is used to contact the provider

Notifications host: api.jpush.cn
Devices host: device.jpush.cn
base url: /v3/
protocol: https
Authorization: Basic

Troubleshooting

1. Register Failed with server error

The following error appears:

E/JIGUANG-JCore: [ConnectingHelper] Register Failed with server error - code:1005
W/JIGUANG-JCore: [ConnectingHelper] Local error description: Your appKey and android package name are not matched. Please double check them according to Application you created on Portal.

As detailed by the warning, please check the Android Package Name property matches the Jiguang Platform configuration.

2. no value for onesignal_app_id is provided

The following error occurs:

error: c:\models\sampleKB\Data\mobile\Huawei\TestPushNotifications\src\main\AndroidManifest.xml Error:
error: Attribute meta-data#onesignal_app_id@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_app_id> is provided.
error: c:\models\sampleKB\Data\mobile\Huawei\TestPushNotifications\src\main\AndroidManifest.xml Error:
error: Attribute meta-data#onesignal_google_project_number@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.

When using the Notifications Provider property to JPush and Huawei generation, make sure to turn off the UseHuaweiNotifications property.

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant