Skip to content
This repository has been archived by the owner on Jul 5, 2019. It is now read-only.

Commit

Permalink
Better manage internal settings. Add new api-key to Loggly.
Browse files Browse the repository at this point in the history
  • Loading branch information
haxpor committed Jan 6, 2018
1 parent 7a1f434 commit ab61f50
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Potatso.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1ED659011E05C73100D4BEE3 /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ED659001E05C73100D4BEE3 /* CloudKit.framework */; };
1ED659061E05E88C00D4BEE3 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ED659051E05E88C00D4BEE3 /* GameKit.framework */; };
1ED66DEE1E05A72300638808 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ED66DED1E05A72300638808 /* StoreKit.framework */; };
1EE85E0C2000639700C5DB6C /* InfoInternal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EE85E0B2000639700C5DB6C /* InfoInternal.swift */; };
1EEBB8771FFFD4B500EB33C3 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEBB8761FFFD4B500EB33C3 /* NetworkExtension.framework */; };
1EEBB8781FFFD52700EB33C3 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEBB8761FFFD4B500EB33C3 /* NetworkExtension.framework */; };
1EEBB8791FFFD8A700EB33C3 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEBB8761FFFD4B500EB33C3 /* NetworkExtension.framework */; };
Expand Down Expand Up @@ -345,6 +346,7 @@
1ED659001E05C73100D4BEE3 /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; };
1ED659051E05E88C00D4BEE3 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
1ED66DED1E05A72300638808 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
1EE85E0B2000639700C5DB6C /* InfoInternal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoInternal.swift; sourceTree = "<group>"; };
1EEBB8761FFFD4B500EB33C3 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
1EF602941F113A660005E0C7 /* GeoLite2-Country.mmdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = "GeoLite2-Country.mmdb"; sourceTree = "<group>"; };
217DDEB43D39CFD980088F46 /* Pods-PotatsoModel.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PotatsoModel.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PotatsoModel/Pods-PotatsoModel.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1294,6 +1296,7 @@
9BC6002F1CB299DE00E5EA61 /* NSError+Helper.h */,
9BC600301CB299DE00E5EA61 /* NSError+Helper.m */,
9BC600211CB2921C00E5EA61 /* Info.plist */,
1EE85E0B2000639700C5DB6C /* InfoInternal.swift */,
);
path = PotatsoBase;
sourceTree = "<group>";
Expand Down Expand Up @@ -3176,6 +3179,7 @@
9BC6002C1CB2922E00E5EA61 /* Potatso.m in Sources */,
9BC600341CB299DE00E5EA61 /* NSError+Helper.m in Sources */,
B8F784681D3678B400F02FF5 /* Settings.m in Sources */,
1EE85E0C2000639700C5DB6C /* InfoInternal.swift in Sources */,
9BC600321CB299DE00E5EA61 /* JSONUtils.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
2 changes: 1 addition & 1 deletion Potatso/AppInitializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AppInitializer: NSObject, AppLifeCycleProtocol {
DDLog.add(fileLogger)

let logglyLogger = LogglyLogger() // Loggy Logger
logglyLogger.logglyKey = "io.wasin-secretkeyblabla"
logglyLogger.logglyKey = InfoInternal.shared.getLogglyAPIKey()
let fields = LogglyFields()
fields.userid = User.currentUser.id
fields.appversion = AppEnv.fullVersion
Expand Down
2 changes: 2 additions & 0 deletions Potatso/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
<dict>
<key>GroupIdentifier</key>
<string>group.io.wasin.potatso</string>
<key>LogglyAPIKey</key>
<string>488db635-457d-48f4-8818-ffcd489f588b</string>
</dict>
<key>UIBackgroundModes</key>
<array>
Expand Down
26 changes: 26 additions & 0 deletions PotatsoBase/InfoInternal.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// InfoInternal.swift
// PotatsoBase
//
// Created by Wasin Thonkaew on 1/6/18.
// Copyright © 2018 TouchingApp. All rights reserved.
//

import Foundation

public class InfoInternal: NSObject {
public static let shared = InfoInternal()
var infoDict: Dictionary<String, Any>

fileprivate override init() {
infoDict = Bundle.main.infoDictionary!["PotatsoInternal"] as! Dictionary<String, Any>
}

public func getGroupIdentifier() -> String {
return infoDict["GroupIdentifier"] as! String
}

public func getLogglyAPIKey() -> String {
return infoDict["LogglyAPIKey"] as! String
}
}

0 comments on commit ab61f50

Please sign in to comment.