Skip to content

Commit 2dbd26f

Browse files
Steve TreaseSteve Trease
authored andcommitted
Various changes to get and publish build numbers
1 parent 225c013 commit 2dbd26f

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Swift Push 3/AppDelegate.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1717
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
1818
// Override point for customization after application launch.
1919

20-
// var versionNumber: AnyObject = NSBundle.mainBundle().infoDictionary["CFBundleVersion"]
21-
// println ("version \(versionNumber)")
20+
let versionNumber: AnyObject? = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"]
21+
println ("version \(versionNumber!)")
2222

2323
var item = NotificationData()
24-
// item.alert = "Swift Push (\(versionNumber)) starting on " + UIDevice.currentDevice().name
25-
item.alert = "Swift Push starting on " + UIDevice.currentDevice().name
24+
item.alert = "Swift Push (\(versionNumber!)) starting on " + UIDevice.currentDevice().name
2625
notifications.insert(item, atIndex: 0)
2726

2827
switch (application.applicationState) {
@@ -51,7 +50,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5150
NSNotificationCenter.defaultCenter().addObserverForName(UIApplicationUserDidTakeScreenshotNotification, object: nil, queue: mainQueue) { notification in
5251
println("screenshot taken")
5352
}
54-
5553
return true
5654
}
5755

@@ -63,15 +61,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
6361
NSUserDefaults.standardUserDefaults().setObject(deviceToken.description as String, forKey:"deviceToken")
6462
NSUserDefaults.standardUserDefaults().synchronize()
6563

66-
var receipt = NSBundle.mainBundle().appStoreReceiptURL?.lastPathComponent
64+
let receipt = NSBundle.mainBundle().appStoreReceiptURL?.lastPathComponent
65+
let versionNumber: AnyObject? = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"]
6766

6867
// register device token with push service
6968
var request = NSMutableURLRequest(URL: NSURL(string: "http://www.trease.eu/ibeacon/swiftpush/")!)
7069
var session = NSURLSession.sharedSession()
7170
request.HTTPMethod = "POST"
72-
var bodyData = "token=" + deviceToken.description
73-
+ "&device=" + UIDevice.currentDevice().name
74-
+ "&mode=" + receipt!
71+
var bodyData = "token=\(deviceToken.description)"
72+
bodyData += "&device=\(UIDevice.currentDevice().name)"
73+
bodyData += "&mode=\(receipt!)"
74+
bodyData += "&version=\(versionNumber!)"
7575
request.HTTPBody = bodyData.dataUsingEncoding(NSUTF8StringEncoding)
7676
var connection = NSURLConnection(request: request, delegate: self, startImmediately: false)
7777
connection?.start()

Swift Push 3/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>289</string>
22+
<string>295</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIBackgroundModes</key>

Swift Push 3/NotificationsTableViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class NotificationsTableViewController: UITableViewController, UISearchBarDelega
8787

8888
// let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "ReuseCell")
8989

90-
cell.layer.cornerRadius = 10.0
90+
// cell.layer.cornerRadius = 10.0
9191
cell.layer.masksToBounds = true
9292
cell.textLabel?.numberOfLines = 0
9393
cell.detailTextLabel?.numberOfLines = 0

Swift Push 3/Settings.bundle/Root.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<array>
77
<dict>
88
<key>DefaultValue</key>
9-
<string>289</string>
9+
<string>295</string>
1010
<key>Key</key>
1111
<string>CurrentBuildNumber</string>
1212
<key>Title</key>

0 commit comments

Comments
 (0)