Skip to main content

OH_CommonEvent_CreateSubscriber

Function OH_CommonEvent_CreateSubscriber 

Source
pub unsafe extern "C" fn OH_CommonEvent_CreateSubscriber(
    info: *const CommonEvent_SubscribeInfo,
    callback: CommonEvent_ReceiveCallback,
) -> *mut CommonEvent_Subscriber
Available on crate features commonevent and api-12 only.
Expand description

Create a subscriber.

§Arguments

  • info - Indicates the created subscribe Info.

  • callback - Indicates the received common event callback.

§Returns

  • Returns the CommonEvent_Subscriber, if allocate memory failed, returns null.

Available since API-level: 12