04/29/2024 11:54:47

I. Policy description

I. Policy description

Before accessing the Kwai channel, you need to contact jessehuang and timwmtian to evaluate the channel strategy. Only after passing the evaluation can you access it normally. Due to strategic reasons, the Kwai channel currently only supports Android.

II. Function description

II. Function description

The Kwai channel supports the login function. You can log into the game/app through your Kwai account. It also supports the friend function. You can pull the friend list, you can send link-type private messages to the Kwai friends you have followed, and you can send video-type works to your own Kwai homepage. MSDK5.7 (GCloud2.0.13) version starts to support the Kwai channel. For details, please refer to the following description.

2.1 Login function

Support in-game/in-app login through Kwai channel, as shown in the figure below. As for descriptions about authorized login, automatic login and logout, please refer to Client-Login Module and backend -Login authentication for instructions.

Pay special attention to the following descriptions:
1.Kwai App package name is com.smile.gifmaker. The game/app can use this package name to judge whether the Kwai App is installed through MSDKV5 Judge whether the App is installed. If the Kwai App is not installed, the player can choose the Kwai channel to log in the game, as shown in the figure below.

2.The Kwai channel's ID is 17, and the channel name is Kwai, which is case sensitive;
3.When calling MSDKLogin.Login, you can fill in the following permissions. If you do not fill in the permissions, you will have "following" and "relation" permissions by default. Among them, the "following" permission represents the permission of getting the list of following friends. With the permission, you can get the list of in-game friends who follow each other. The "relation" permission represents the relationship permission, which allows you to get the list of in-game friends who you follow;

C#
C++
MSDKLogin.Login ("Kwai", "following,relation", "", "");
GCloud::MSDK::MSDKLogin::Login("Kwai", "following,relation", "", "");

4.Kwai platform logic. Switching Kwai account can only be done in Kwai App;
5.Kwai channel login only needs authorization once. Subsequent logins with the same account do not need authorization any longer.
(1)After a Kwai account is authorized, it has a validity period of 30 days. After the validity period is exceeded, it needs to be re-authorized if it is launched again;
(2) When a Kwai account is authorized, Android will not skip to the Kwai App, as shown in the figure below.

2.2 Friend function

Support the in-game/in-app acquisition of the list of in-game friends I am following in Kwai, as shown in the figure below. For more instructions, please refer to Client-Friend Module, Client-Share Module, Backend-Personal Information and Backend-Friend Relationship. The Kwai channel's sending/sharing function only supports sending link messages and sharing video works, and do not support other sending/sharing types. For details, please refer to the description below.

After successful in-game/in-app login through Kwai channel, you can send the link type of private messages to Kwai friends, as shown in the figure below. As for the description of sending messages, please refer to Send message to friend for interface guidelines

Pay special attention to the following descriptions:
1.Required fields, including type, title, desc (content), link and thumbPath (thumbnail, no more than 52KB);
2.Support sending messages to the specified friend. It is needed to fill the specified openid in the "User" field of MSDKFriendReqInfo;

3.In case of a one-way following friend, if the private message delivery permission is set to "mutually following friends", as shown in the figure below, the friend will not be listed in the private message delivery list when a link message is sent. If you want to send private messages to a friend, you must follow each other at first (the setting path of the private message delivery permission: Kwai Settings-->Privacy Settings-->Who Can Send Private Messages to Me);

2.2.2 Share video works

After successful in-game/in-app login through Kwai channel, you can share video works to your Kwai homepage, as shown in the figure below. As for more instructions about sharing, please refer to Share Information.

Pay special attention to the following descriptions:
1.Required fields, including type, mediaPath (multimedia address; it is required to fill in the local path);
2.The shared video works, as shown in the picture above, will be kept in Kwai App, without callback;
3.Support mov and mp4 formats, and have no limit to the length of the file. The tag can be passed through the ExtraJson field of MSDKFriendReqInfo. It is a video tag similar to #XXX Final#. The format is extraJson="{\"tags\": "game , share"}". Use commas to separate tags;

III. Feiying system configuration

III. Feiying system configuration

The Feiying system has opened up the Kwai channel's application registration pathway. Games which want to access Kwai need to get Kwai channel's application information through the Feiying system and then send it to the server.

3.1 Get Kwai AppID and Kwai AppKey

Games which want to access Kwai need to contact jessehuang at first, jessehuang will then collaborate Feiying system product manager zhenzhizhao to registration of the Kwai channel. After registration, the games can get Kwai AppID and Kwai AppKey from Feiying System --> Game Management-->My Game-->SDK Parameter page, as shown in the figure below.

3.2 The Feiying system issues Kwai channel configuration

Go to Feiying system --> Game Management --> My Game --> Login Information page to check the Kwai channel under the corresponding joint debugging/formal environment, fill in the corresponding channel information and then click the "Publish" button.

Pay special attention to the following description:
If the Feiying system does not issue Kwai channel configuration, this will cause the login to be unable to launch Kwai login, and MSDK will return errors such as "Config error, it could be invalid gameid or channeled";

After accessing the Kwai channel, the Android project needs to add permissions required by Kwai and configure Activity and Kwai-related configuration items in MSDKConfig.ini to meet the normal use of the Kwai channel after access.

[Android Life Cycle Monitoring]
MSDK_LIFECYCLE_OBSERVERS = QQ,WeChat,Kwai

[Kwai channel configuration]
KWAI_APP_ID = {YOUR_KWAI_APP_ID}
KWAI_ENABLE_H5LOGIN = 1

[Kwai debugging configuration ]
MSDK_DEBUG = 1
MSDK_DEBUG_CHANNEL = Kwai

Pay special attention to the following descriptions:
1.Need to replace {YOUR_KWAI_APP_ID} with Kwai AppID registered for the game. As for how to get Kwai AppID, please refer to the description in 4.1;
2.When Kwai App is not installed, the value of KWAI_ENABLE_H5LOGIN is 1, meaning to use the H5 page to log into Kwai. If the value is 0, this means not to use H5 to log into Kwai, and a login failure callback will be returned, showing an error like "NEED_INSTALL_APP";
3.If the value of {MSDK_DEBUG} is 1, this means to turn on the debugging mode. If the value is 0, this means to turn off the debugging mode. If {MSDK_DEBUG_CHANNEL}, a switch, is set to Kwai, this means to turn on Kwai debugging. Only when {MSDK_DEBUG} is 1 does this switch take effect. These are set in the same configuration file;

4.4 Code obfuscation

-ignorewarnings
-verbose

# Generics and reflection
-keepattributes Signature
-keepattributes EnclosingMethod
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable,*JavascriptInterface*,Signature

# Keep annotation
-keepattributes *Annotation*
-keep class * extends java.lang.annotation.Annotation {*;}

# Keep serialization
-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}
-keep public class * implements java.io.Serializable {*;}
-dontwarn android.os.**

#Keep the enum class from being obfuscated
-keepclassmembers enum * {
  public static **[] values();
  public static ** valueOf(java.lang.String);
}
-keep class com.kwai.**{*;}
V. Server configuration

V. Server configuration

The backend of the game/app is only required to be accessed normally and doesn't need any special processing. For details, please refer to Backend - General Description. It deserves special attention that Kwai channel's channelid is 17 and it supports Login Authentication, Personal Information and in-game Friends and other interfaces.

VI. Frequently Asked Questions

VI. Frequently Asked Questions

As for some common questions and descriptions about access to the Kwai channel, you can refer to the following content.

6.1 Kwai login error: "Config error, it could be invalid gameid or channeled"

Solution: This problem is caused by the failure of the game to issue the Kwai channel configuration in the Feiying system. Please refer to this article's 3.2 section "The Feiying system issues Kwai channel configuration" and go there to solve this problem.

6.2 Kwai login error: "Inner token is invalid[3]"

Solution: This problem is caused by invalid token or the abnormal environment for the use of token. It is necessary to check whether the token has expired, or check if the front-end and backend of the game/app use the token data of the same MSDK environment (joint debugging environment/formal environment).

6.3 Kwai login error 6 (Login with a mobile phone number that has not registered a Kwai account)

Detailed error log: {"ret":-1,"msg":"","openid":"","token_expire_time":0,"first":0,"reg_channel_dis":"","user_name":"","picture_url":"","need_name_auth":false,"channel_info":"","bind_list":"","confirm_code":"","confirm_code_expire_time":0,"channelid":0,"retCode":6,"retMsg":"Timeout","token":"","gender":0,"pf":"","pfKey":"","channel":"","methodNameID":112,"extraJson":""}
Solution: If you log into Kwai via web with a mobile account that has not registered a Kwai account, you have to wait for a verification code and enter the account number and the verification code for login, so the login process is time-consuming. Therefore, it is recommended to guide games to adjust the timeout period (MSDK_LOGIN_OVERTIME and MSDK_HTTP_TIMEOUT) to avoid this problem.

6.4 Android Kwai login. When I click the "Cancel Authorization" button, MSDK returns 9999

Solution: MSDK does not encapsulate the error code 1005 of Kwai SDK for the cancellation of authorization. It is recommended to guide the business through ThirdCode to determine the error code of Kuaishou canceling authorization.

Detailed error log: (KwaiFriend$ShareListener.java: 318) onResult]: Kwai share callback, ret MSDKRet{methodNameID=212, retCode=11, retMsg='Invalid argument', thirdCode=6003, thirdMsg='req checkArgs fail.', extraJson='null'}
Solution: Retrieve "MSDK: SendMessage infoJson" in the log, and view the input parameters of the sent link message. Check whether type, title, desc (content), link and thumbPath (thumbnail, no more than 52KB) are filled in correctly. It is recommended to guide games to fill in these parameters or fill in them again after the parameters are modified.

6.6 Kwai channel. An error "No support" appears when I share video works through Kwai channel

Detailed error log: MSDK: OnMSDKMessage, result=212@&@{"ret": 1, "msg": "", "methodNameID": 212, "retCode": 7, "retMsg": "No support", "extraJson": ""}

Solution: Kwai channel only supports sending link messages and sharing video works. Sending/sharing other types of messages are not supported. This error occurs when the sending/sharing types not supported by Kwai are used. After encountering such an error, you need to check the sending/sharing type in the request and guide the game to fill in the message type and then try again.



Copyright © 2024 MSDK.
All rights reserved.

results matching ""

    No results matching ""