Integrate ShiplyPro iOS SDK
I. Privacy and Security Notice
Shiply Pro SDK
Version: 1.1.0
Last Updated: April 29, 2025
SDK Description: Provides mobile developers with dynamic configuration switch delivery, dynamic resource file delivery, in-app upgrade, and online hotfix capabilities
Service Provider: Shenzhen Tencent Computer Systems Co., Ltd.
Integration Guide: Integrate ShiplyPro iOS SDK
Privacy Protection Rules: 《Shiply Pro SDK Personal Information Protection Rules》
II. Integration Guide
2.1 Configure CocoaPods Dependencies
Integrate ShiplyPro.xcframework through the CocoaPods Podfile
# Add mirror source
source 'https://github.com/CocoaPods/Specs'
# Integrate all capabilities (recommended)
pod 'ShiplyPro', '1.1.0'
If you want to integrate modules on demand
# Integrate remote config capability
pod 'ShiplyPro', '1.1.0', :subspecs => ['Core', 'RemoteConfig']
# Integrate remote resource capability (RemoteConfig is the underlying capability for all subsystems, so remote resources also include the RemoteConfig module)
pod 'ShiplyPro', '1.1.0', :subspecs => ['Core', 'RemoteResource']
If GitHub is inaccessible, you can use the Tencent Coding source
pod 'ShiplyPro', :git => "https://cnb.cool/tencent-tds/Shiply-Pro-iOS.git", :tag => '1.1.0'
2.2 Minimal Integration
#import <ShiplyPro/Shiply.h>
#import <ShiplyPro/ShiplyLoggerProtocol.h>
ShiplyParams *params = [[ShiplyParams alloc] init];
params.appId = @"29f3fb41fe";
params.appKey = @"7332bf11-142b-44d0-8ea3-d45d3655f7de";
params.deviceId = @"your_unique_deivce_id";
params.userId = @"your_unique_user_id";
struct utsname systemInfo;
uname(&systemInfo);
NSString *devModel = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
params.devModel = devModel;
params.hostAppVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
params.systemVersion = [[UIDevice currentDevice] systemVersion];
params.platform = ShiplyPlatformIOS;
self.shiply = [[Shiply alloc] initWithParams:params loggerDelegate:self];
#pragma mark - ShiplyLoggerProtocol
- (void)logMsg:(NSString *)msg level:(RAFTLogLevel)level {
// Shiply does not upload logs automatically. Print Shiply logs to your logging system. Provide Shiply logs when reporting issues.
NSLog(@"%@", msg);
}
III. Use Configuration Release
3.1 Get SDK
RDeliverySDK *sdk = [self.shiply getRDeliveryInstance];
// If some business code reads config during initialization, config may not be loaded yet. Implement RDConfigEventListener and read config in onConfigInfoInited.
[sdk addConfigEventListener:self];
3.2 Get Configuration Value
When the remote end does not have this configuration switch key, the configuration has not been pulled, or the web console has not set a value for this key, defaultValue is returned.
NSString *stringValue = [self.rdeliverySDK stringValueWithKey:configKey defaultValue:@"{\"k1\":\"v1\"}"];
3.3 Get Switch Value
When the remote end does not have this configuration switch key, the configuration has not been pulled, or the switch value for this key on the web console is "Not Set", defaultValue is returned.
BOOL isSwitchOn = [self.rdeliverySDK isSwitchOn:configKey defaultValue:NO];
3.4 Get Configuration Object (RDConfigInfo type)
RDConfigInfo *info = [self.rdeliverySDK configInfoWithKey:configKey];
3.5 More Usage
See: Use Configuration and Switches
IV. Use Resource Release
4.1 Get SDK
ResHub *sdk = [self.shiply getResHubInstance];
4.2 Download a Specific Resource
[[self resHub] loadLatestWithId:resId
progress:^(CGFloat progress) {
} completed:^(BOOL success, NSError * _Nullable error, ResHubModel * _Nullable resModel) {
}];
4.3 Read Resources Downloaded Locally
ResHubModel *model = [[self resHub] latestResWithId:[self resId]];