- Restructure as yarn workspace with packages/common, im, push, update
- @xuqm/rn-common: built-in URLs (no apiBaseUrl/imWsUrl in init), init({appId, debug})
- @xuqm/rn-im: login(userId) handles token internally, no token in public API
- @xuqm/rn-update: registerPlugin({moduleId,version}) for self-registration,
checkAppUpdate() auto-detects version via XuqmVersionModule native bridge,
checkRnUpdate(moduleId) uses registered version (no app-layer arg)
- Add XuqmVersionModule native stubs for Android/iOS
- Keep @xuqm/rn-sdk as convenience meta-package re-exporting all
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 行
579 B
Objective-C
22 行
579 B
Objective-C
#import <React/RCTBridgeModule.h>
|
|
|
|
@interface XuqmVersionModule : NSObject <RCTBridgeModule>
|
|
@end
|
|
|
|
@implementation XuqmVersionModule
|
|
|
|
RCT_EXPORT_MODULE();
|
|
|
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getVersionCode) {
|
|
NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
|
return @([build integerValue]);
|
|
}
|
|
|
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getVersionName) {
|
|
NSString *version = [[[NSBundle mainBundle] infoDictionary]
|
|
objectForKey:@"CFBundleShortVersionString"];
|
|
return version ?: @"0.0.0";
|
|
}
|
|
|
|
@end
|