Exploration and practice of JD financial client user contact methods

1. About user contact

User touch: It can be simply understood as the behavior of delivering a message to the user in a certain way; the specific message of touch can be divided into two layers of display and guidance in terms of function. As a product operation method, user reach has been integrated into all aspects of our daily production activities. In the world of mobile Internet, our products are inseparable from touch, and user activities are also inseparable from touch.

 

2. Why do user engagement

From the user's point of view, users will have some system-related notifications in the process of using the App, such as transaction logistics, customer service messages, billing information, loan and repayment reminders, real-time information and other messages that need to be sent to users in a timely manner. remind;

From the perspective of APP operation activities, in the daily operation process of the APP, according to the current goal, combined with the activity, it sends relevant marketing information to users, such as the activity information of a single product or some category promotion offers, etc., to guide users to quickly enter the activity page;

Therefore, touch plays an important role in operating activities such as attracting new people, promoting activation, retention, realization, and self-propagation. This article introduces some practices in user engagement from the perspective of app development.

 

Third, the practice of reaching users

There are two ways to achieve access from the survival state of the APP. One is: off-site access when the APP is inactive, mainly including: SMS, Push, desktop widgets, etc.

The other is: in-site contact when the APP is active, mainly including in-site pop-up windows, page fixed operation positions, feed stream recommendation positions, etc.

The following is a brief introduction to several contact methods we have implemented and some problems encountered.

Method 1: SMS

At the beginning, the most widely used scenario of SMS was as a way for us to communicate. With the development of the times, instant messaging apps such as WeChat and QQ gradually replaced SMS as a communication tool between people. The feature of message synchronization to users is still the most widely used way of reaching messages. Common application scenarios include verification code notifications, repayment reminders, account changes, and marketing campaign notifications. We know that as a way of reaching, its mission is not only to notify users of messages, but also to easily guide users to jump to the corresponding landing pages in the APP for specific messages.

There is no doubt about the message reachability of SMS. Although we can also open the links directly placed in the text of the SMS, there are some limitations. This method only supports opening web pages and cannot jump to the native page of the APP. Clicking on the link will pop up a window first, and the user will choose to open the linked app. This experience is greatly reduced compared to directly opening the specified page of the app. Therefore, how to directly reach the APP through SMS

The corresponding landing page is the problem we need to solve. Google provides a way to enable the Android system to open the corresponding content page of the application directly through the website address, without requiring the user to choose which application to use to process the website address, namely Android App Links; the workflow is as follows:

 

To add Android App Links to an application, you need to define an intent filter in the application that opens the application through the Http(s) address, and verify that you actually own the application and the website.

If the system successfully verifies that you own the website, the system will directly route the intent corresponding to the URL to your application.

1. Configure IntentFilter for system verification in AndroidManifest:

When android:autoVerify="true" appears in any of your intent filters, when you install the app on Android 6.0 and above, it will trigger the system to verify each domain name related to the URL in the app. The verification process is designed with the following steps:

The system will check all intent filters with the following characteristics: Action is
android.intent.action.VIEW , Category is
android.intent.category.BROWSABLE and
android.intent.category.DEFAULT , Data scheme is http or https

2. Configure a Json file for a digital asset link to declare the relationship between your URL and the application;

For each unique domain name found in the above intent filter, the Android system will look for the digital asset file under the corresponding domain name. The address is: https://domain name/ .well-known/
assetlinks.json

Only when the system finds the corresponding digital asset file for each domain name found in the AndroidManifest will the system set your app as the default handler for a specific link.

Examples of digital assets:

package_name: application ID defined in build.gradle

sha256_cert_fingerprints: SHA256 fingerprint information of application signature, this field supports multiple fingerprint information, which can be used to support different application versions, such as development version and release version, and then publish assetlinks to https:
//domain/.well-known/assetlinks. json

[
  {
    "relation": [
      "delegate_permission/common.handle_all_urls"
    ],
    "target": {
      "namespace": "android_app",
      "package_name": "xxx.xxx.xx",
      "sha256_cert_fingerprints": [
        "xx:xx...."
      ]
    }
  }
]

3. Jump to landing page

Parse the url in the Activity configured with the above intent filter, and perform operations such as jumping to the landing page

4. Problems and troubleshooting methods

If the link of the SMS cannot be jumped normally after configuration, you can check whether the relevant configuration is correct one by one.

4.1 Verify that digital asset files are correctly defined and published:

https://digitalassetlinks.googleapis.com/v1/statements:list?

source.web.site=https://your domain name: optional port

&relation=delegate_permission/common.handle_all_urls

4.2 Confirm whether the application has set the correct link processing method:

adb shell am start -a android.intent.action.VIEW \

-c android.intent.category.BROWSABLE \

-d "http://your-domain-name:optional-port"

4.3 Check Linking Policy

This step needs to be executed after a period of 10s after the application is installed, because the system will request to parse the configuration table after the application is installed

Execute: adb shell dumpsys package domain-preferred-apps or adb shell dumpsys package d

This command returns a list of the configuration of each application on the device, this list indicates the association between the application and the website

App linkages for user 0:

Package: com.android.demo represents the application package name

Domains: play.google.com market.android.com website domain name, separate multiple websites with spaces

Status: always : xxxx indicates that the application is configured with android:autoVerify="true" in the Manifest file, and the status is always; the following xxxx has nothing to do with whether the verification is successful or not, but is related to the configuration record of the application in the system; 

4.4 Solve the problem of model compatibility and adaptation

In the process of practice, it was also found that different models of devices from various manufacturers could not jump to the landing page. After analyzing the application installation on this model, the system failed to parse the configuration table assetlinks process, and the system default browser will be used at this time. Open the landing page, the landing page is the native page of the app and cannot be jumped to the landing page. For the web page that needs to be logged in, if it is not registered in the login center, it will fail to jump and redirect to m.jd.com.

Solution: For models with problems, use the unified download page for transfer, the download page executes the evoking APP, and the APP handles the logic of jumping to the landing page.

Reach method 2: Push push

1. Client push solution

Google provides FCM push for Android, but its availability is not good due to some reasons such as network services; at present, all domestic manufacturers of rom also provide free push push access capability, which greatly saves touch compared to push because of its freeness. reach cost.

At the same time, there are also some third-party push service providers in China. We combine the characteristics of JD Finance’s own business, in order to ensure the security of data and the service quality of push messages, and finally adopt the integration of Huawei, Xiaomi, OPPO, ViVO, and Meizu manufacturers’ push capabilities and self-built channel combination scheme.

Among them, the characteristics of the manufacturer's push: within the validity period of the token, the user can receive the push message after killing the app; the characteristics of the self-built channel: after the app is started, the connection is established, and the push message is received. After the app is killed, the push message cannot be received. Users of devices from manufacturers such as Samsung and Nubia receive push messages.

The implementation of the push solution by each manufacturer is basically the same (the manufacturer's push access process, the figure below takes MiPush as an example), and we also encountered many problems in the process of using the manufacturer's push, so we understand the characteristics of each manufacturer. the premise of the reach strategy.

 

2. Problems encountered by manufacturer push

2.1 Can the push notification message be personalized?

Usually, the main contents of the notification bar message display effect include the message title, summary, application icon and time. The client can define the specific display content by itself.

Different manufacturers such as Huawei, OPPO, vivo, Xiaomi, Meizu and other notification bar styles have some different comprehensive comparisons as follows:

 

In terms of the style of notification display, we can see that Huawei supports the inBox style, and OPPO and Xiaomi support the large picture style. These features can be used to customize a more distinctive notification display form to highlight the notification theme.

Huawei inBox style: The Inbox style displays each line of content as an independent single line of text. The text content can be displayed in up to 5 lines, and "..." is automatically added after each line of content cannot be displayed.

OPPO Xiaomi supports big picture style: this kind of notification can show more attractive pictures to users

 

2.2 The App has many business push notifications. Can users specify to receive classified messages?

As the business of the APP becomes more and more complex, there are more and more notifications of the application, causing obvious disturbance to the user;

Users can only globally block all notifications of this application, but not part of them, and then leave the ones that are useful to them.

In order to solve this problem, Android 8.0 began to support developers to divide their own notifications into several categories, and then allow users to block notifications of this category individually.

It is necessary to classify channels and add new channels (take MiPush as an example):

ChannelHelper channelHelper = new ChannelHelper(APP_SECRET);
ChannelInfo channelInfo = new ChannelInfo.Builder()
        .channelId("id") //必填,通知类别的ID,长度不超过 200 字符
        .channelName("name") //必填,通知类别的名称,长度不超过40字符
        .channelDesc("desc") //可选,通知类别的描述,长度不超过300字符
        .notifyType(0) //必填,通知的效果类型,仅支持0,即振动、提示音、led灯三种效果都无
        .soundUrl("sound_url") //可选,通知的自定义铃声uri,格式介绍请参见 “4.1 自定义铃声”
        .build();
Result result = channelHelper.addNewChannel(channelInfo, 1)

Different channels are displayed in the notification settings of the system settings page as follows:

 

 

 

By subdividing the categories of push notifications, increasing the number of channels can improve the retention rate of push messages in the notification bar;

At the same time, users can have more choices, set the type of messages they are more concerned about, and avoid too much interruption to improve the user experience.

2.3 How to specify the push method or crowd

The push methods supported by each manufacturer are as follows:

 

2.3.1 Push based on ReglD

RegID is a unique identifier generated by the Push SDK when registering the push service for each app on each device.

When developers need to push messages to one or more specific devices, they can use RegID-based push to push personalized information to specified devices. This method is suitable for scenarios where personalized push needs to be customized for each user.

2.3.2 Alias-based push

Alias ​​is a personalized setting provided by push. The developer can set the user's account in the app or other user's unique identifier as the alias of the RegID of the user's device, and the push can be directly based on the alias in the push.

Aliases are not only convenient for developers to associate the push with their own account system, but also avoid the additional development and storage costs caused by the need to save the corresponding relationship between the device RegID and their own account.

2.3.3 Tag-based push

Push to users who have subscribed to push and have set tags under the app. When pushing a message, the developer can select the corresponding label based on the content of each message and the target user group. After completing the request, the push push service will send all

Users with this tag send this message to meet the needs of targeted push. And provides label management function.

2.3.4 Xiaomi channel userAccount: It can correspond to a maximum of 20 devices, a single account can log in to multiple devices, and push a userAccount, and 20 devices can receive messages at the same time.

Summary: Send specific push messages to user groups such as different client versions, different regions, men and women in a specific way, or push specific messages by labeling different user groups to achieve The purpose of more granular push.

2.4 OPPO and ViVO reach low power, how to improve

After accessing the data kanban, after comparing the reach rates of various manufacturers, it is found that the reach rates of OPPO and ViVO are basically 83%~86%, while the reach rates of Xiaomi and Huawei channels are basically 94%~98%. Therefore, OPPO is improved. , VIVO Tongda's reaching power is another problem we face

OPPO: After investigation, it was found that the main factor affecting the reach rate of OPPO is the status of the notification switch: the APP can only receive push messages from the manufacturer when the notification switch is turned on, and the OPPO and OnePlus notification switches are turned off by default after installation by the user. Therefore, Push messages are not received.

Solution: In the early stage, it was mainly to formulate a guidance strategy, detect the status of the notification switch at the right time, and guide the user to actively go to the settings page to open it. Later, after investigation, it was found that OPPO's ColorOS system provides the ability to turn on the notification switch with one click, and later use the one-click guide to turn on the notification switch. Open the plan, and increase the reach rate of OPPO channel to about 94%;

VIVO: Unlike OPPO, the notification switch is turned on after the app is installed on the VIVO device. According to the data provided by the data warehouse and the error code analysis of the manufacturer's feedback, the main factor that leads to the low reach of VIVO is that the messages are not classified and are limited.

Vivo channel message types are divided into two categories - messages are divided into "operational messages" and "system messages" according to whether the message type is strongly related to the user. The missed message classification function will cause all messages to default to operational messages and be subject to frequency control restrictions , so important messages may not be reached.

The maximum number of daily operation messages received by a single application of vivo users is 5, and there is no limit to system messages. The limit of the number of pieces received by a single application of a vivo user is based on whether the "reach volume" exceeds 5 pieces. Check whether the single user reaches 5 pieces at the time of sending, and the excess will be included in the control volume.

In addition to VIVO, Huawei, OPPO, and Xiaomi all have certain restrictions on the number of notification messages. For manufacturer channels with quotas, the personalized push strategy with high click-through rate should be arranged to be pushed in the morning as much as possible, which can ensure the arrival rate of high-quality push content. ; Improve the reach rate of push messages by increasing the amount of push messages.

2.5 How to enhance the reminder of unread messages

The number of unread messages can be displayed on the corner label of the App desktop. The manufacturer's lunch app and push sdk provide corresponding capability support to enhance reminders. The implementation details of each manufacturer are different:

Huawei : The unreading of the corner mark is controlled by the push message sent by the server. The API has been opened for third-party applications to set the unread mark of the corner mark. The number of corner marks in the notification bar message will not change.

Xiaomi : The unread number of the corner mark is equal to the number of unread notifications of the app received by the manufacturer's push channel (system notification bar), and the API is open for third-party applications to set the unread mark of the corner mark. The system notification bar message is removed, and the number of corner labels is correspondingly reduced.

oppo : supports red dots, digital corner markers, the unread number of corner markers is equal to the number of unread notifications of the app received by the manufacturer's push channel (system notification bar).

vivo: The desktop corner mark unread switch is turned off by default and needs to be manually turned on by the user to use it, providing the ability to set the corner mark unread.

Problems and solutions of angle label adaptation:

2.5.1 The number of notifications can be displayed on the Xiaomi system, but the number of internal messages cannot be updated.

Solution: The in-station message and push are connected, and the synchronous update is not read when entering the app.

2.5.2 The number of pushes cannot be displayed on the Huawei system, but the number of messages on the site is displayed normally.

Solution: Huawei Push Service provides an API interface for setting desktop banners on the server side, and third-party apps can encapsulate banner parameters in messages.

2.5.3 On vivo mobile phones, it is not supported to display the unread corners.

Solution: Update the SDK version and access the corner mark capability

2.5.4 Only the number of in-site messages is displayed on the OPPO corner logo.

When the push function is activated, you can apply for three forms of dot corner mark, digital corner mark, and no corner mark. Users can choose independently in the notification settings.

The system version supported by oppo push currently supports OPPO models with  ColorOS3.1 and above systems , OnePlus 5/5t and above models, and all realme models ( devices after Android 8.0 ). 

2.5.5 Others: Meizu mobile phone does not open the desktop corner icon setting.

 

Reach Method 3: Banners on the Site

1. Introduction to the banner scheme in the site

The existing touch methods do not cover the scenes generated by the user's real-time behavior, and this kind of scene is more real-time than the offline scene, and is relatively more important to the user. In response to this situation, we have added real-time scene coverage.

The purpose is to abstract user behavior into a relationship model. When the user behavior on one side of the relationship changes, the touch on the other side is triggered. This situation is more real-time and strongly related to the user. The message clicks and conversions of the touch are both It is relatively high, which is also conducive to enhancing user stickiness.

 

Overview of the overall design of the site banner

Data service layer : Each business module is responsible for collecting user behavior data, and the molo side abstracts the user behavior relationship model, the user enters the specified scene, triggers the corresponding scene reach strategy, and then is verified by the unified frequency control and quantity control.

Transport layer : Hawkeye's self-built channel based on the long link of the MQTT protocol, passing the verified touch signal to the next process

APP basic capability layer: provide basic capabilities for reaching message transmission and process monitoring

Data parsing layer: parsing the delivered touch message body, verifying its validity, and monitoring abnormal data

View control layer: Create touch message template views, identify pop-up methods, inject life cycle into touch message views through ViewCore, enter and exit animations, sound vibration reminders, display animations and other customized attributes

2. Application scenario of horizontal column in JD Finance App Station

After the in-site horizontal bar function is launched, it provides an effective approach strategy for a batch of businesses

 

 

 

3. Problems encountered and solutions

3.1 How to make the horizontal bar global in the App station

The global pop-up window is relatively easy to implement, mainly relying on the registered page life cycle monitoring, using WindowManager to remove the view when leaving the page, and re-adding it when entering a new page;

3.2 The specified page is displayed or the specified page is not displayed

The premise of specifying a page is to be able to distinguish which page it is. There are two cases:

For web pages, first obtain the specified web link configured on the Eagle Eye platform, and then obtain the link address of the web page that is currently being added through the web container of the APP. To match the two addresses, it is necessary to pay attention to the existence of parameters in the locally obtained url There are more cases than operational configurations, so when matching, we believe that as long as the locally obtained parameters include the parameters in the configured address, the matching is successful;

Native page, method 1, routing address matching: we first take the routing information of the native page, there is routing information locally to match according to the routing address, if the native page does not have a routing address, it needs to be adapted

Method 2, popClass matching: The classpath of the native page needs to be entered into the background page configuration table for maintenance, and the matching is performed according to the classpath of the page

3.3 How to avoid the problem of losing multiple horizontal bar messages

It supports multiple horizontal bars at the same time. What needs to be paid attention to here is the synchronization of horizontal bar information. We created an attribute information object for the horizontal bar when creating the horizontal bar. Each horizontal bar attribute information has a unique key. The attributes are cached, and the maximum threshold is set for the cache. When the threshold is reached, the last horizontal bar disappears and the cache information is cleared.

Summary: The horizontal bar access solution in the station is an exploration of our intelligent access method. After the function is launched, it provides a more intelligent operation method for white bars, insurance, wealth, funds, installment and other businesses. The success rate of reaching news reached 98%, and the click-through rate reached 12%~16%, helping related businesses to increase by more than 40%

Reach Method 4: Desktop Widgets

AppWidget is also known as widget, widget or widget. It is a special design that is displayed on the Launcher and can provide more information than the Logo; it is convenient for users to directly view information and conduct simple interactions without opening the App.

  • Android has already provided this capability in the early days, but there are relatively few applications, such as clock, weather, calendar, etc.;
  • iOS 10 introduces widgets, until iOS 14 is fully supported, which may be affected by this, Android 12 improves widget API, improving user and developer experience

1. Create AppWidget

In general, it is divided into the following parts:

1.1 Define AppWidgetProvider

Create an AppWidgetProvider subclass, and create the corresponding AppWidgetProviderInfo configuration file
example_appwidget_info.xml, and declare it in the manifest

1.2 Set the basic properties of appWidget

AppWidgetProviderInfo defines the basic characteristics of the widget, such as the minimum layout size of the app widget, the initial layout resources of the app widget, the update frequency of the app widget, and (optionally) the configuration activity that is started when the app widget is created. You can define an AppWidgetProviderInfo object in an XML resource using a single <appwidget-provider> element and save it in your project's res/xml/ folder

1.3 Drawing the layout of the widget

The layouts that AppWidget can support are as follows (because its bottom layer is implemented based on RemoteViews, it supports fewer views):

  • FrameLayout、LinearLayout、RelativeLayout、GridLayout

The supported Views are as follows (custom Views are not supported):

    • AnalogClock、Button、Chronometer、ImageButton、ImageView、ProgressBar、TextView、ViewFlipper、ListView、GridView、StackView、AdapterViewFlipper

1.4 Configure Configuration Activity

When the app widget uses the configuration Activity, the Activity is responsible for initializing the app's widget after the configuration is complete

1.4.1 Get widget id

1.4.2 Execute app widget configuration

1.4.3 After the configuration is complete, get the instance of AppWidgetManager by calling getInstance  ( Context)  

  1.4.4 Update the app widget with the  RemoteViews layout by calling updateAppWidget(int, RemoteViews) 

1.4. 5. Finally, create a return Intent, set the Activity result for it, and end the Activity

1.4.6 Set preview image

When choosing to create an appWidget, a picture that depicts what the app widget looks like is displayed to the user. When not configured, the app logo is displayed by default.

1.4.7 Configure Service

When a specific item in the collection is requested, the RemoteViewsFactory  creates the corresponding item for the collection and returns it as a  RemoteViews  object. To add a collection view in appWidget, you must implement  RemoteViewsService  and  RemoteViewsFactory .

For details, see the official demo:
https://android.googlesource.com/platform/development/+/master/samples/StackWidget/src/com/example/android/stackwidget/StackWidgetService.java

1.4.8 Set click event

Usually  setOnClickPendingIntent()  is used to set the click behavior of an object - for example, to have a button start an  Activity . However, this method is not allowed for subviews within individual collection items. If you want to add click behavior to individual items in the collection, you should use  setOnClickFillInIntent() instead . This requires setting up a pending Intent template for the collection view, and then  setting the populating intent on each item in the collection via the RemoteViewsFactory . 

2. Implementation of common apps

 

The realization of financial APP:

 

3. Problems in Widget Practice

3.1 How to crop a picture with rounded corners

Generally, Glide is used to crop the picture during the development process. It should be noted that the use of Glide in the widget is slightly different from usual. Because the corresponding View view cannot be obtained, AppWidgetTarget is more suitable for the scene of loading the picture in the widget, and it can be easily combined with MultiTransformation. Crop image rounded corners

AppWidgetTarget appWidgetTarget = new AppWidgetTarget(context, ivViewId, views, mAppWidgetIds);RequestOptions option = new RequestOptions()                .transform(new MultiTransformation<>(                        new CenterCrop(),                        new RoundedCorners(ToolUnit.dipToPx(mContext, connerDp))));GlideApp.with(context)                    .asBitmap()                    .load(bgUrl)                    .apply(option)                    .diskCacheStrategy(DiskCacheStrategy.NONE)                    .into(appWidgetTarget);

3.2 How to implement custom fonts

The widget itself does not support custom views. If you want to support custom fonts, you can set the font style, thickness, color, background and other attributes for the text through Canvas draw text.

3.3 Dealing with click response delays

The click event is processed through the broadcast form PendingIntent.getBroadcast , there is a delay on some models, the longest is about 7s; you can use the setOnClickPendingIntent method instead, and you need to process the corresponding events in the jump center of the app, such as jumping to the landing page, burying points Wait

3.4 How to develop an update strategy

In order to avoid excessive resource occupation by widgets, the system rejects frequent updates by default, and sets the minimum update time to 30 minutes; this default refresh method is not suitable for interactive widgets, and the page status may become out of sync after the user operates Question, how to solve this problem? First of all, according to the needs of business scenarios, we can also divide refresh into two categories:

Business scenarios with certain real-time requirements: such as news information

By creating a Service to open a scheduled task, formulate the update time interval, such as executing an update task every 5 minutes;

User interaction type business scenarios: such as check-in, collecting points, energy, etc.; such scenarios do not require frequent data refresh, but a reasonable automatic refresh time needs to be configured, and the page needs to be refreshed after user operations; the app can be registered when the app starts The internal page life cycle monitors
ActivityLifecycleCallbacks, realizes the ability to judge the front-end and back-end monitoring capabilities of the APP, and sends a broadcast to refresh the widget when the app enters the background, triggering the refresh of the widget; or encapsulates a unified method to provide an interface for the business to actively trigger the refresh of the corresponding widget

 

summary

This article mainly shares the exploration and practice process, problems and solutions encountered by the JD financial client technical team on SMS, push, in-site banners, and widgets. I hope to provide some ideas for students who are exploring user access solutions; in order to allow users to have a better experience when using our products, and to efficiently reach users during the operation of the product, JD.com's technical team is in While continuing to polish the existing solutions, we will continue to explore and practice more intelligent and efficient reaching solutions.

{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/4090830/blog/5577860