Skip to content

Commit

Permalink
Use public channel and make config file
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Sep 25, 2018
1 parent 6638b88 commit 83ca294
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
9 changes: 7 additions & 2 deletions LineSDKSample/LineSDKSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
4B9058BA21006E9C004D717F /* LineSDKSampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LineSDKSampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4B9058BE21006E9C004D717F /* LineSDKSampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineSDKSampleUITests.swift; sourceTree = "<group>"; };
4B9058C021006E9C004D717F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4B9AB20D2159EE1500B8C22C /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
4BB8445C211BD41A005B60D7 /* APIHomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHomeViewController.swift; sourceTree = "<group>"; };
4BB8445E211BD4DF005B60D7 /* APIStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIStore.swift; sourceTree = "<group>"; };
4BB84460211BE5E7005B60D7 /* APIResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIResultViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -182,6 +183,7 @@
4B9058A521006E9C004D717F /* Assets.xcassets */,
4B9058A721006E9C004D717F /* LaunchScreen.storyboard */,
4B9058AA21006E9C004D717F /* Info.plist */,
4B9AB20D2159EE1500B8C22C /* Config.xcconfig */,
);
path = LineSDKSample;
sourceTree = "<group>";
Expand Down Expand Up @@ -335,6 +337,7 @@
};
4B9058B921006E9C004D717F = {
CreatedOnToolsVersion = 9.4.1;
LastSwiftMigration = 1000;
TestTargetID = 4B90589A21006E9B004D717F;
};
};
Expand Down Expand Up @@ -623,6 +626,7 @@
};
4B9058C421006E9C004D717F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 4B9AB20D2159EE1500B8C22C /* Config.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
Expand All @@ -640,6 +644,7 @@
};
4B9058C521006E9C004D717F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 4B9AB20D2159EE1500B8C22C /* Config.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
Expand Down Expand Up @@ -708,7 +713,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDKSampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = LineSDKSample;
};
Expand All @@ -727,7 +732,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.linecorp.LineSDKSampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = LineSDKSample;
};
Expand Down
9 changes: 8 additions & 1 deletion LineSDKSample/LineSDKSample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

LoginManager.shared.setup(channelID: "1539955650", universalLinkURL: nil)
// Modify Config.xcconfig to setup your LINE channel ID.
if let channelID = Bundle.main.infoDictionary?["LINE Channel ID"] as? String,
let _ = Int(channelID)
{
LoginManager.shared.setup(channelID: channelID, universalLinkURL: nil)
} else {
fatalError("Please set correct channel ID in Config.xcconfig file.")
}

return true
}
Expand Down
27 changes: 27 additions & 0 deletions LineSDKSample/LineSDKSample/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Config.xcconfig
//
// Copyright (c) 2016-present, LINE Corporation. All rights reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by LINE Corporation.
//
// As with any software that integrates with the LINE Corporation platform, your use of this software
// is subject to the LINE Developers Agreement [http://terms2.line.me/LINE_Developers_Agreement].
// This copyright notice shall be included in all copies or substantial portions of the software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974

LINE_CHANNEL_ID = 1606667895
LINE_SDK_URL_SCHEME = line3rdp
LINE_AUTH_URL_SCHEME = lineauth2
6 changes: 4 additions & 2 deletions LineSDKSample/LineSDKSample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>line3rdpb.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>$(LINE_SDK_URL_SCHEME).$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LINE Channel ID</key>
<string>$(LINE_CHANNEL_ID)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>lineauth2</string>
<string>$(LINE_AUTH_URL_SCHEME)</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
Expand Down

0 comments on commit 83ca294

Please sign in to comment.