32 lines
992 B
Plaintext
32 lines
992 B
Plaintext
#import <Foundation/Foundation.h>
|
|
|
|
#import "FirebaseSDK.h"
|
|
#import "NativeUtils.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// 初始化SDK
|
|
void FIRInitialize() {
|
|
[[FirebaseSDK getInstance] initialize];
|
|
}
|
|
|
|
// 设置公共事件属性
|
|
void FIRSetUserProperty(const char* key, const char* property) {
|
|
[[FirebaseSDK getInstance] setUserPropertyString:[NSString stringWithFormat:@"%s", property] forName:[NSString stringWithFormat:@"%s", key]];
|
|
}
|
|
|
|
void FIRLogEvent(const char* eventName, const char* properties) {
|
|
[[FirebaseSDK getInstance] logEventWithName:[NSString stringWithFormat:@"%s", eventName] parameters:[NativeUtils convertJsonToDictionary:properties]];
|
|
}
|
|
|
|
// log crash
|
|
void FIRLogCrashCustomKey(const char* key, const char* stack) {
|
|
[[FirebaseSDK getInstance] logCrash:[NSString stringWithFormat:@"%s", key] stack:[NSString stringWithFormat:@"%s", stack]];
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|