Skip to content

Commit

Permalink
Update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
bretdabaker committed May 26, 2018
1 parent 523f4a6 commit 41ea98d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
4 changes: 4 additions & 0 deletions OneSkyOTADemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
048AE61C20B93C04003F5201 /* TestBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 048AE61B20B93C04003F5201 /* TestBundle.bundle */; };
FB56D8A41BA2C0C0001FB4B7 /* libOneSkyOTAPlugin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FB56D8A21BA2C0C0001FB4B7 /* libOneSkyOTAPlugin.a */; };
FB6757DD19933E1C00E96A12 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB6757DB19933E1C00E96A12 /* Storyboard.storyboard */; };
FB6757E019933E3100E96A12 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = FB6757DE19933E3100E96A12 /* Localizable.strings */; };
Expand All @@ -20,6 +21,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
048AE61B20B93C04003F5201 /* TestBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = TestBundle.bundle; path = "../../plugin-ios-ota-src/OneSkyOTADemo/TestBundle.bundle"; sourceTree = "<group>"; };
FB56D8A01BA2C0C0001FB4B7 /* OneSkyOTAPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneSkyOTAPlugin.h; sourceTree = "<group>"; };
FB56D8A11BA2C0C0001FB4B7 /* ibsupport */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = ibsupport; sourceTree = "<group>"; };
FB56D8A21BA2C0C0001FB4B7 /* libOneSkyOTAPlugin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libOneSkyOTAPlugin.a; sourceTree = "<group>"; };
Expand Down Expand Up @@ -117,6 +119,7 @@
FB7344F61980C9E40062424F /* Supporting Files */ = {
isa = PBXGroup;
children = (
048AE61B20B93C04003F5201 /* TestBundle.bundle */,
FB6757DE19933E3100E96A12 /* Localizable.strings */,
FB7344F71980C9E40062424F /* OneSkyOTADemo-Info.plist */,
FB7344F81980C9E40062424F /* InfoPlist.strings */,
Expand Down Expand Up @@ -181,6 +184,7 @@
buildActionMask = 2147483647;
files = (
FB7344FA1980C9E40062424F /* InfoPlist.strings in Resources */,
048AE61C20B93C04003F5201 /* TestBundle.bundle in Resources */,
FB6757E019933E3100E96A12 /* Localizable.strings in Resources */,
FB7345021980C9E40062424F /* Images.xcassets in Resources */,
FB6757DD19933E1C00E96A12 /* Storyboard.storyboard in Resources */,
Expand Down
30 changes: 19 additions & 11 deletions OneSkyOTADemo/OSAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,35 @@ @implementation OSAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
/*
/*
For security reason you might not want to embed the API secret in
the source code of your application, in this case you can skip the
API secret by setting the string output API privacy to public,
the source code of your application, in this case you can skip the
API secret by setting the string output API privacy to public,
Go to "Project settings > Privacy > String out API" on OneSky platform
for details.
*/
[OneSkyOTAPlugin provideAPIKey:@"E1pO0tjuOJ9xWw4VmqargWcD4YDEq7AU"
APISecret:nil
projectID:@"56727"];
[OneSkyOTAPlugin checkForUpdate];

// force language
[OneSkyOTAPlugin setLanguage:@"zh-HK"];

// set a custom log level
[OneSkyOTAPlugin setLogLevel:OneSkyLogLevelInfo];

// Test OSLocalizedString calls
NSLog(@"Monday = %@", OSLocalizedString(@"Monday", nil));
NSLog(@"Tuesday = %@", OSLocalizedString(@"Tuesday", nil));

// Force language
[OneSkyOTAPlugin setLanguage:@"pt-PT"];

// Enable debug option, default is YES
[OneSkyOTAPlugin setDebug:YES];

// Fallback to specific bundle for callback
NSString *testBundlePath = [[NSBundle mainBundle] pathForResource:@"TestBundle" ofType:@"bundle"];
NSBundle *testBundle = [NSBundle bundleWithPath:testBundlePath];
// register before use
[OneSkyOTAPlugin registerFallbackBundles:@[testBundle]];
NSLog(@"Tuesday = %@", OSLocalizedStringFromTableWithFallbackToBundle(@"Tuesday", nil, testBundle, nil));

// Custom default value
NSLog(@"Wednesday = %@", OSLocalizedStringWithDefaultValue(@"Wednesday", @"Days", @"Default Day", nil));

return YES;
}
Expand Down
4 changes: 2 additions & 2 deletions OneSkyOTADemo/OneSkyOTADemo-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.9.12</string>
<string>0.10.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>33</string>
<string>34</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down

0 comments on commit 41ea98d

Please sign in to comment.