Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build updates #41

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
[submodule "external/ELHASO-iOS-snippets"]
path = external/ELHASO-iOS-snippets
url = git://github.com/gradha/ELHASO-iOS-snippets.git
[submodule "external/DCIntrospect"]
path = external/DCIntrospect
url = git://github.com/gradha/DCIntrospect.git
[submodule "external/EHReachability"]
path = external/EHReachability
url = git://github.com/gradha/EHReachability.git
19 changes: 11 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Record my GPS position
======================

:author: Grzegorz Adam Hankiewicz <gradha@imap.cc>
:author: Grzegorz Adam Hankiewicz <ef@gradha.imap.cc>

.. contents::

Expand Down Expand Up @@ -53,12 +53,12 @@ __ http://efaber.net/
App store
=========

.. image:: https://github.com/downloads/svet/Record-my-position/record_my_gps_position_qr_appstore.png
.. image:: https://cloud.github.com/downloads/svet/Record-my-position/record_my_gps_position_qr_appstore.png
:align: right

Record my GPS position can be downloaded for free from the Apple
App Store
(http://itunes.com/apps/electrichandssoftware/recordmygpsposition/).
(https://itunes.apple.com/app/record-my-gps-position/id405865492?mt=8).


Requests and issues
Expand All @@ -74,11 +74,14 @@ Source code
Requirements
------------

The source code uses SDK 4.1 and deploys on 3.x. Patches are welcome
to make it compile out of the box with previous SDK versions. In
order to dynamically generate the versioned splash number, you need
Cobra (http://cobra-language.com/) to compile the
``script/watermark.cobra`` program and run it.
The source code compiles against SDK 8.0, which is the current lowest supported
SDK by Apple. Previous to the 8.0 update the code supported deployment on 3.x
OS versions, but that's not Apple's cup of tea, you are presumed to upgrade
your hardware every year, so you likely won't make use of that anyway.

In order to dynamically generate the versioned splash number, you need Cobra
(http://cobra-language.com/) to compile the ``script/watermark.cobra`` program
and run it.


Installation
Expand Down
353 changes: 87 additions & 266 deletions Record_my_position.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion external/DCIntrospect
Submodule DCIntrospect deleted from fb6aaa
4 changes: 1 addition & 3 deletions external/egf/hardware.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// vim:tabstop=4 shiftwidth=4 syntax=objc
/**
* \file hardware.h
* \brief Functions to query the underlying hardware.
Expand Down Expand Up @@ -47,7 +48,6 @@ struct Hardware_info_t
HW_FAMILY family; // Hardware family.
char version; // Zero or positive means recognised version.
char *name; // Hardware name as C string.
char udid[UDID_LEN + 1]; // UDID plus NULL terminator.
};


Expand All @@ -56,5 +56,3 @@ void destroy_hardware_info(Hardware_info **info);


#endif // __EGF_HARDWARE_H__

// vim:tabstop=4 shiftwidth=4 syntax=objc
18 changes: 2 additions & 16 deletions external/egf/hardware.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// vim:tabstop=4 shiftwidth=4 encoding=utf-8 syntax=objc
// vim:tabstop=4 shiftwidth=4 syntax=objc

#include "egf/hardware.h"

Expand Down Expand Up @@ -34,26 +34,12 @@
}
info->name = calloc(1, size);
if (!info->name) {
DLOG(@"Not enough memory to get hardware name (%lu).", size);
DLOG(@"Not enough memory to get hardware name (%ld).", size);
free(info);
info = 0;
goto exit;
}

info->udid[0] = 0;
UIDevice *dev = [UIDevice currentDevice];
NSString *udid = dev.uniqueIdentifier;
if (udid) {
if (UDID_LEN == strlen([udid cStringUsingEncoding:1])) {
strncpy(info->udid, [udid cStringUsingEncoding:1], UDID_LEN);
info->udid[UDID_LEN] = 0;
} else {
DLOG(@"Unexpected UDID length for '%@'.", udid);
}
} else {
DLOG(@"Couldn't read UDID.");
}

sysctlbyname("hw.machine", info->name, &size, 0, 0);
DLOG(@"Retrieved hardware string '%s'.", info->name);

Expand Down
38 changes: 0 additions & 38 deletions resources/Er_recorder.plist

This file was deleted.

22 changes: 16 additions & 6 deletions resources/Record_my_position-appstore.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string>Icon.png</string>
<key>CFBundleIdentifier</key>
<string>com.elhaso.recordmyposition</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -20,19 +20,29 @@
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>CFBundleVersion</key>
<string>1.4.2</string>
<key>LSRequiresIPhoneOS</key>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>NSLocationAlwaysUsageDescription</key>
<string>This permission is needed to record your location even when you switch away from the app.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This permission is needed to record your location even when you switch away from the app.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This permission is needed to record your location even when you switch away from the app.</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
24 changes: 16 additions & 8 deletions resources/Record_my_position-dev.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,38 @@
<key>CFBundleIconFile</key>
<string>Icon.png</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>CFBundleVersion</key>
<string>1.4.2</string>
<key>LSRequiresIPhoneOS</key>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>NSLocationAlwaysUsageDescription</key>
<string>This permission is needed to record your location even when you switch away from the app.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This permission is needed to record your location even when you switch away from the app.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This permission is needed to record your location even when you switch away from the app.</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
13 changes: 1 addition & 12 deletions src/App_delegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

#import "EHReachability.h"

#ifdef USE_DCINTROSPECT
#ifdef TARGET_IPHONE_SIMULATOR
#import "DCIntrospect.h"
#endif
#endif

/** \mainpage Record my position
*
* \section meta Meta
Expand Down Expand Up @@ -86,15 +80,10 @@ - (BOOL)application:(UIApplication *)application
launch_options]];

tab_controller_ = [Tab_controller new];
[window_ addSubview:tab_controller_.view];
[window_ setRootViewController:tab_controller_];

[window_ makeKeyAndVisible];

#ifdef USE_DCINTROSPECT
#if TARGET_IPHONE_SIMULATOR
[[DCIntrospect sharedIntrospector] start];
#endif
#endif
return YES;
}

Expand Down
1 change: 1 addition & 0 deletions src/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef enum ACCURACY_ENUM ACCURACY;
+ (NSString*)key_path;
- (id)init;
- (bool)start;
- (void)requestPermissions;
- (void)stop;
- (void)add_watcher:(id)watcher;
- (void)remove_watcher:(id)watcher;
Expand Down
16 changes: 15 additions & 1 deletion src/GPS.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,14 @@ + (NSString*)degrees_to_dms:(CLLocationDegrees)value latitude:(BOOL)latitude
*/
- (bool)start
{
if (manager_.locationServicesEnabled) {
const CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
BOOL shouldWork = (kCLAuthorizationStatusAuthorizedWhenInUse == status
|| kCLAuthorizationStatusAuthorizedAlways == status);

if (!shouldWork)
return false;

if ([CLLocationManager locationServicesEnabled]) {
if (!self.gps_is_on && !nolog_)
[[DB get] log:@"Starting to update location"];

Expand All @@ -165,6 +172,13 @@ - (bool)start
}
}

/** Requests the OS to ask the user for always permissions.
*/
- (void)requestPermissions
{
[manager_ requestAlwaysAuthorization];
}

/** Stops the GPS tracking.
* You can call this function anytime, doesn't really fail.
*/
Expand Down
File renamed without changes.
Loading