Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Commit

Permalink
Added iOS 10+ compatible openURL method. Also, fixed Carthage support…
Browse files Browse the repository at this point in the history
… by adding dynamic framework
  • Loading branch information
ArtSabintsev committed Oct 12, 2017
1 parent 26a9ca3 commit 59ee6e2
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 29 deletions.
6 changes: 3 additions & 3 deletions Harpy/Harpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ typedef NS_ENUM(NSUInteger, HarpyAlertType)
It will specifically be used to test the string localizations.
@param stringKey: The string that should be looked up and localized.
@param stringKey The string that should be looked up and localized.
@return The localized string.
*/
Expand All @@ -204,7 +204,7 @@ typedef NS_ENUM(NSUInteger, HarpyAlertType)
It will specifically be used to temporarily set the installed version of the app.
@param version: The temporary version that should be set for the app.
@param version The temporary version that should be set for the app.
*/

Expand All @@ -216,7 +216,7 @@ typedef NS_ENUM(NSUInteger, HarpyAlertType)
It will specifically be used to temporarily set the app store version of the app.
@param version: The temporary version that should be set for the app.
@param version The temporary version that should be set for the app.
*/

Expand Down
6 changes: 5 additions & 1 deletion Harpy/Harpy.m
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ - (void)launchAppStore {
NSURL *iTunesURL = [NSURL URLWithString:iTunesString];

dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] openURL:iTunesURL];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:iTunesURL options:@{} completionHandler:nil];
} else {
[[UIApplication sharedApplication] openURL:iTunesURL];
}

if ([self.delegate respondsToSelector:@selector(harpyUserDidLaunchAppStore)]){
[self.delegate harpyUserDidLaunchAppStore];
Expand Down
19 changes: 19 additions & 0 deletions HarpyExample/Harpy/Harpy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Harpy.h
// Harpy
//
// Created by Arthur Sabintsev on 10/11/17.
// Copyright © 2017 Arthur Ariel Sabintsev. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for Harpy.
FOUNDATION_EXPORT double HarpyVersionNumber;

//! Project version string for Harpy.
FOUNDATION_EXPORT const unsigned char HarpyVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Harpy/PublicHeader.h>


24 changes: 24 additions & 0 deletions HarpyExample/Harpy/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
Loading

0 comments on commit 59ee6e2

Please sign in to comment.