Android SDK API
SDK Interface Description
- JOperateInterface,include SDK All interfaces.
SDK Initialize
Supported Version
description 2.0.8
Interface definition
- initialize()
- Interface description:
- Initialization interface. Recommendation Application Yes. onCreate Medium Call
Call Example
JOperateInterface. getInstance(getApplicationContext()).initialize();
SDK Initialization (Cancellation)
Supported Version
description 2.0.0 description 2.0.8
Interface definition
- init()
- Interface description:
- Initialization interface. Recommendation Application Yes. onCreate Medium Call
- description 2.0.8
Call Example
JOperateInterface. getInstance(getApplicationContext()).init();
Enable Business Functions
Supported Version
description 2.0.8
Interface definition
- operationStart()
- Interface description:
- Enable behavioral analysis anduser profileInterface. Recommendation Application Yes. onCreate Medium Call
- operationStartThe interface is the start-up interface for the other interfaces, so you have to call first. operationStartInterface to call other interfaces
- Call the interface, enable behavioral analysis anduser profilefunction, you start to report SDKUser information for business functions
Call Example
JOperateInterface. getInstance(getApplicationContext()).operationStart();
Settings Debug Mode
Supported Version
description 2.0.0
Interface definition
- setDebug(boolean enable)
- Interface description:
- Settings to open debug Mode. true will print more log information. Recommendation init Call before interface.
- Parameter description:
- enable: debug Switches
Call Example
JOperateInterface. setDebug(true);
Set User ID
Supported Version
description 2.0.0
Interface definition
- login(JSONObject property, final CallBack callBack)
- Interface description:
- Sets user identifiers, such as user membership card numbers.
- Parameter description:
- property: User ID
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, as detailed msg Parameter Description
- msgReason description
Call Example
JSONObject property = new JSONObject();
try {property. put("key1", "fffff");// 用户一级标识
property. put("key2", "13407589860");// 用户二级标识
} catch (Throwable e) {e. printStackTrace();
}
JOperateInterface. getInstance(getApplicationContext()).login(property, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {Log. d(TAG, "login code:" + code + ",msg:" + msg);
}
});
Set User Contacts
This interface can be used to update the user 's "contacts" in the "Touch Channel" - "Contact Tag" when the contact details of the user change.
Supported Version
description 2.0.0
Interface definition
- setChannel(JSONObject data, final CallBack callBack)
- Interface description:
- Set a "contact" for the user to specify the Contact Tab under Channel ID.
- Initial contact label name is "Default Contact" and setting a custom name requires addition to the platform interface first Contact Tags.-Notsupported.-SettingsAPPThevalue of the "contact label" for notification must be the user's Registration ID.- When setting the "SMS Contact Tab" value must be 11 digit (cell phone number format)
- Parameter description:
- data: Set multiple channels
- Structure as {touch channel] id:{contact label: contact }
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, as detailed msg Parameter Description
- msgReason description
Call Example
- The project adds a touchable channel that depends on the developer ' s initiative to set the relevant channel values for each user to send the message properly.
- Synchronizes the contact channel values when the user's contact channel information changes. For example, when a user binds a mobile phone number to a change, you need to synchronize the text message to reach the channel value.
JSONObject property = new JSONObject();
try {JSONObject contact = new JSONObject();
contact. put("联系标签", "联系方式");
property. put("后台创建的触达通道 ID", contact);
} catch (Throwable e) {e. printStackTrace();
}
JOperateInterface. getInstance(getApplicationContext()).setChannel(property, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {Log. d(TAG, "setChannel code:" + code + ",msg:" + msg);
}
});
Report custom events
Before calling this interface, you need to create it on the consolemeta-event, details Createmeta-event.
Supported Version
description 2.0.0
Interface definition
- onEvent(String eventKey, JSONObject property)
- Interface description:
- Custom Event
- Parameter description:
- eventKey: Event name key
- property: Other properties of events
Call Example
JSONObject property = new JSONObject();
String eventKey = "你的事件名 key";
try {property. put("你的属性名 key", 0);
property. put("你的属性名 key", "你好");
} catch (Throwable e) {e. printStackTrace();
}
JOperateInterface. getInstance(getApplicationContext()).onEvent(eventKey, property);
Access CUID
Supported Version
description 2.0.0
Interface definition
- getCuid()
- Interface description:
- Access cuid description
Call Example
JOperateInterface. getInstance(getApplicationContext()).getCuid();
Access SDK Version Number
Supported Version
description 2.0.0
Interface definition
- getVersion()
- Interface description:
- Get Current SDK Version Number
Call Example
JOperateInterface. getInstance(getApplicationContext()).getVersion();
Register Static Public Properties
Supported Version
description 2.0.0
Interface definition
- registerSuperProperties(JSONObject properties)
- Interface description:
- Registers static public properties, which are included in all post-reported event data, which are stored locally and set to be valid for long periods.
- Parameter description:
- properties: Static Public Properties
Call Example
try {JSONObject properties = new JSONObject();
properties. put("你的属性名","你的属性值");
properties. put("你的属性名 2","你的属性值 2");
properties. put("你的属性名 3","你的属性值 3");
JOperateInterface. getInstance(getApplicationContext()).registerSuperProperties(properties);
} catch (Throwable e) {e. printStackTrace();
}
Clear Static Public Properties
Supported Version
description 2.0.0
Interface definition
- clearSuperProperties()
- Interface description:
- Clear Static Public Properties
Call Example
JOperateInterface. getInstance(getApplicationContext()).clearSuperProperties();
Clear a static public property
Supported Version
description 2.0.0
Interface definition
- unregisterSuperProperty(String superPropertyName)
- Interface description:
- Clear a static public property
- Parameter description:
- superPropertyName: Static Public Properties
Call Example
JOperateInterface. getInstance(getApplicationContext()).unregisterSuperProperty("你想要清除的静态公有属性名");
Register Dynamic Public Properties
Supported Version
description 2.0.0
Interface definition
- registerDynamicSuperProperties(DynamicSuperProperties dynamicSuperProperties)
- Interface description:
- Registers a dynamic public property, and all post-reported event data will contain the property returned from the interface, which is valid only on a current basis.
- Parameter description:
- dynamicSuperProperties: Returns dynamic public properties through this interface class.
Call Example
JOperateInterface. getInstance(getApplicationContext()).registerDynamicSuperProperties(new JOperateInterface. DynamicSuperProperties() {
@Override
public JSONObject getDynamicSuperProperties() {JSONObject properties = new JSONObject();
try {properties. put("你的属性名", "你的属性值");
properties. put("你的属性名 2", "你的属性值 2");
properties. put("你的属性名 3", "你的属性值 3");
} catch (Throwable e) {e. printStackTrace();
}
return properties;
}
});
Settings UTM Properties
Supported Version
description 2.0.0
Interface definition
- setUtmProperties(final JSONObject properties)
- Interface description:
- Settings UTM Properties
- Parameter description:
- Access Jiguang RID
- UTM Properties are preset properties, which can currently be set UTM Properties are:
- utm_source Sources of advertising series
- utm_medium Advertising series media
- utm_term Advertising Words
- utm_content Advertising series content
- utm_campaign Advertising series name
Call Example
try {JSONObject properties = new JSONObject();
properties. put("utm_source","你的属性值");
JOperateInterface. getInstance(getApplicationContext()).setUtmProperties(properties);
} catch (Throwable e) {e. printStackTrace();
}
Set User Properties
Before calling this interface, create user attributes on the console, for more information Create User Properties.
Set User Properties for Overwrite
- profileSet(final JSONObject properties, final CallBack callBack)
- Interface description:
- Sets the user properties of the overwrite.
- Only the latest reported data are kept, covering historical data such as user membership.
- Parameter description:
- properties: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
try {JSONObject properties = new JSONObject();
properties. put("你的用户属性名","你的属性值");
properties. put("你的用户属性名 2","你的属性值 2");
properties. put("你的用户属性名 3","你的属性值 3");
JOperateInterface. getInstance(getApplicationContext()).profileSet(properties, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
} catch (Throwable e) {e. printStackTrace();
}
- profileSet(String property, Object value, CallBack callBack)
- Interface description:
- Sets how to overwrite user attributes.
- Only the latest reported data are kept, covering historical data such as user membership.
- Parameter description:
- property: User Properties
- value: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
JOperateInterface. getInstance(getApplicationContext()).profileSet("你的用户属性名","你的属性值", new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
Set user properties valid only for the first time
- profileSetOnce(final JSONObject properties, final CallBack callBack)
- Interface description:
- Sets only the user attributes that are effective for the first time.
- Only one attribute needs to be set, and subsequent data are ignored when the field has a value, such as the first payment time.
- Parameter description:
- properties: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
try {JSONObject properties = new JSONObject();
properties. put("你的用户属性名","你的属性值");
properties. put("你的用户属性名 2","你的属性值 2");
properties. put("你的用户属性名 3","你的属性值 3");
JOperateInterface. getInstance(getApplicationContext()).profileSetOnce(properties, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
} catch (Throwable e) {e. printStackTrace();
}
- profileSetOnce(final String property, final Object value, CallBack callBack)
- Interface description:
- Sets only the user attributes that are effective for the first time.
- Only one attribute needs to be set, and subsequent data are ignored when the field has a value, such as the first payment time.
- Parameter description:
- property: User Properties
- value: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
JOperateInterface. getInstance(getApplicationContext()).profileSetOnce("你的用户属性名","你的属性值", new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
Set cumulative user properties
- profileIncrement(final Map<String,? extends Number> properties, CallBack callBack)
- Interface description:
- Sets the cumulative user properties.
- Add all reported data, such as cumulative consumption.
- Only the user attribute of a value type can be called, otherwise it will be ignored, and if this user attribute does not exist before, the initial value will be treated as 0.
- Parameter description:
- properties: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
Map<String,Number> properties = new HashMap();
properties. put("你的用户属性名",1);
properties. put("你的用户属性名 2",2);
properties. put("你的用户属性名 3",3);
JOperateInterface. getInstance(getApplicationContext()).profileIncrement(properties, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
- profileIncrement(final String property, final Number value, CallBack callBack)
- Interface description:
- Sets the cumulative user properties.
- Add all reported data, such as cumulative consumption.
- Only the user attribute of a value type can be called, otherwise it will be ignored, and if this user attribute does not exist before, the initial value will be treated as 0.
- Parameter description:
- property: User Properties
- value: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
JOperateInterface. getInstance(getApplicationContext()).profileIncrement("你的用户属性名",1, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
Set User Properties for Adding Method
- profileAppend(final String property, final String value, CallBack callBack)
- Interface description:
- Sets the user properties of the additional method.
- Sustainable addition of the assembly elements, which enter the library to reprocess if they existABC, Add CD, and eventuallyABCD, like the news of the user.
- Parameter description:
- property: User Properties
- value: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
JOperateInterface. getInstance(getApplicationContext()).profileAppend("你的用户属性名","你的用户属性值", new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
- profileAppend(final String property, final Set values, CallBack callBack)
- Interface description:
- Sets the user properties of the additional method.
- Sustainable addition of the assembly elements, which enter the library to reprocess if they existABC, Add CD, and eventuallyABCD, like the news of the user.
- Parameter description:
- property: User Properties
- value: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
- Call Example:
Set<String> properties = new HashSet<>();
properties. add("你的用户属性值");
properties. add("你的用户属性值 2");
properties. add("你的用户属性值 3");
JOperateInterface. getInstance(getApplicationContext()).profileAppend("你的用户属性名",properties, new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
Remove User Properties
Supported Version
description 2.0.0
Interface definition
- profileUnset(final String property, final CallBack callBack)
- Interface description:
- Clear corresponding user properties
- Parameter description:
- property: User Properties
- callBackInterface echoes
- description
onCallBack(int code, String msg) - code: Return code, 0 for success, 1 for failure, details of error code description
- msgReason description
Call Example
JOperateInterface. getInstance(getApplicationContext()).profileUnset("你的用户属性名", new JOperateInterface. CallBack() {
@Override
public void onCallBack(int code, String msg) {}});
Length of statistical event
Supported Version
description 2.0.0
Interface definition
- String onEventTimerStart(String eventName)
- Interface description:
- Event starts timed
- Parameter description:
- eventName: Event Name
- Description
- eventNameKey: Return Event Name key, for follow-up event statistics
- onEventTimerPause(String eventNameKey)
- Interface description:
- Event timeout
- Parameter description:
- eventNameKey: onEventTimerStart Return Events key
- onEventTimerResume(String eventNameKey)
- Interface description:
- The event continues to be timed.
- Parameter description:
- eventNameKey: onEventTimerStart Return Events key
- onEventTimerEnd(String eventNameKey)
- Interface description:
- End of event time and report
- Parameter description:
- eventNameKey: onEventTimerStart Return Events key
- onEventTimerEnd(String eventNameKey, final JSONObject properties)
- Interface description:
- End of event time and report
- Parameter description:
- eventNameKey: onEventTimerStart Return Events key
- properties: Other Properties of the Event
- removeTimer(String eventNameKey)
- Interface description:
- Clear the closure, for example, by half.
- Parameter description:
- eventNameKey: onEventTimerStart Return Events key
- clearTrackTimer()
- Interface description:
- Clear all closure events, for example, and no longer need to be counted in half.
Call Example
JSONObject properties = new JSONObject();
properties. put("你的用户属性名","你的属性值");
properties. put("你的用户属性名 2","你的属性值 2");
properties. put("你的用户属性名 3","你的属性值 3");
JOperateInterface instance = JOperateInterface. getInstance(getApplicationContext());
String eventNameKey = instance. onEventTimerStart("你的事件名");
instance. onEventTimerPause(eventNameKey);
instance. onEventTimerResume(eventNameKey);
instance. onEvent(eventNameKey,properties);
View outlying fields of the newspaper
Supported Version
description 2.0.0
Interface definition
- getPeripheralProperty()
- Interface description:
- View outlying fields of the newspaper
Call Example
JSONObject peripheralProperty = JOperateInterface. getInstance(getApplicationContext()).getPeripheralProperty();
Expand business-related settings
Optional Personal Information Settings
Call this API To configure optional personal data collection
Supported Version
Started Supported Version 2.0.9We need to work together. JCore Android SDK v4.6.0and above
Interface definition
JOperateInterface. getInstance(getApplicationContext()).setCollectControl(JOperateCollectControl);
Parameter Definition
context
Apply Context
JOperateCollectControl
Collection Controls Configuration Category
Call Example
JOperateCollectControl. Builder builder = new JOperateCollectControl. Builder();
builder. imei(true);//true 可采集imei, 默认为true, false-关闭
JOperateCollectControl jOperateCollectControl = builder. build();
JOperateInterface. getInstance(getApplicationContext()).setCollectControl(jOperateCollectControl);
Expand Business Functional Settings
Call this API To configure extended operations
Supported Version
Started Supported Version 2.0.9We need to work together. JCore Android SDK v4.6.0and above
Apply Self Start
JCollectionAuth. enableAutoWakeup(Context context,boolean isAutoWakeupEnable);
Parameter Definition
context
Apply Context
isAutoWakeupEnable
Apply self-start switch, default totrue, false-Representatives Close