From 0090030f3daaecccfda1f2e45f953b3737af3ff4 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Mon, 24 Aug 2015 00:28:50 +0200 Subject: [PATCH] Adding rating code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’ve noticed that most people went to the App Store to leave really bad reviews of the app and it is severely affecting our discoverability. We will ask for a rating if we see you’ve been using the app for some time. If you rate the app or decline to rate, that’s fine. We will never bug you again! --- Podfile | 1 + Podfile.lock | 3 ++ Pods | 2 +- Signal.xcodeproj/project.pbxproj | 6 ++++ Signal/src/AppDelegate.m | 5 ++++ Signal/src/util/AppStoreRating.h | 15 ++++++++++ Signal/src/util/AppStoreRating.m | 28 ++++++++++++++++++ .../translations/en.lproj/Localizable.strings | Bin 27226 -> 27742 bytes 8 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 Signal/src/util/AppStoreRating.h create mode 100644 Signal/src/util/AppStoreRating.m diff --git a/Podfile b/Podfile index eb633f097..5ebd61c00 100644 --- a/Podfile +++ b/Podfile @@ -14,6 +14,7 @@ pod 'Mantle', '~> 2.0.4' pod 'FFCircularProgressView', '~> 0.5' pod 'SCWaveformView', '~> 1.0' pod 'YapDatabase/SQLCipher', '~> 2.7' +pod 'iRate', '~> 1.11' pod 'SSKeychain' pod 'DJWActionSheet' diff --git a/Podfile.lock b/Podfile.lock index 046812507..41d891134 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -37,6 +37,7 @@ PODS: - DJWActionSheet (1.0.4) - FFCircularProgressView (0.5) - HKDFKit (0.0.3) + - iRate (1.11.4) - JSQMessagesViewController (7.1.0): - JSQSystemSoundPlayer (~> 2.0.1) - JSQSystemSoundPlayer (2.0.1) @@ -68,6 +69,7 @@ DEPENDENCIES: - AxolotlKit (~> 0.7) - DJWActionSheet - FFCircularProgressView (~> 0.5) + - iRate (~> 1.11) - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController`, commit `e5582fef8a6b3e35f8070361ef37237222da712b`) - libPhoneNumber-iOS (~> 0.8.7) @@ -112,6 +114,7 @@ SPEC CHECKSUMS: DJWActionSheet: 2fe54b1298a7f0fe44462233752c76a530e0cd80 FFCircularProgressView: 683a4ab1e1bd613246a3dffa61503ffdebcde8d8 HKDFKit: c058305d6f64b84f28c50bd7aa89574625bcb62a + iRate: 599ed07c854e0695f3c605d1b2a64c67d912acb7 JSQMessagesViewController: ca11f86fa68ca70835f05e169df9244147c1dc40 JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d libPhoneNumber-iOS: 1bccd3288375d954b0b904e26061cecaa0fb83d6 diff --git a/Pods b/Pods index c43d25e93..1101c9b71 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit c43d25e93c1b3d25a866e618ff1b45f3a940f332 +Subproject commit 1101c9b712ac694978812826833de1177e71a7a4 diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index dd8b1a458..c03665dd8 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -400,6 +400,7 @@ B6C6AE551A305ED1006BAF8F /* redphone.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE531A305ED1006BAF8F /* redphone.cer */; }; B6C6AE561A305ED1006BAF8F /* textsecure.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE541A305ED1006BAF8F /* textsecure.cer */; }; B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; }; + B6DA6B071B8A2F9A00CA6F98 /* AppStoreRating.m in Sources */ = {isa = PBXBuildFile; fileRef = B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */; }; B6E314C91A38FAAF00A41AFB /* TSFingerprintGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E314C81A38FAAF00A41AFB /* TSFingerprintGenerator.m */; }; B6F509971AA53F760068F56A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6F509951AA53F760068F56A /* Localizable.strings */; }; B6FAAAE81A41BC6C007FEC1D /* TSAttachmentPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = B6FAAAE71A41BC6C007FEC1D /* TSAttachmentPointer.m */; }; @@ -1080,6 +1081,8 @@ B6C6AE541A305ED1006BAF8F /* textsecure.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = textsecure.cer; sourceTree = ""; }; B6C93C4C199567AD00EDF894 /* DebugLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLogger.h; sourceTree = ""; }; B6C93C4D199567AD00EDF894 /* DebugLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugLogger.m; sourceTree = ""; }; + B6DA6B051B8A2F9A00CA6F98 /* AppStoreRating.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppStoreRating.h; sourceTree = ""; }; + B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppStoreRating.m; sourceTree = ""; }; B6E314C71A38FAAF00A41AFB /* TSFingerprintGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSFingerprintGenerator.h; sourceTree = ""; }; B6E314C81A38FAAF00A41AFB /* TSFingerprintGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSFingerprintGenerator.m; sourceTree = ""; }; B6F509961AA53F760068F56A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = translations/en.lproj/Localizable.strings; sourceTree = ""; }; @@ -1753,6 +1756,8 @@ 76EB04C818170B33006006FC /* util */ = { isa = PBXGroup; children = ( + B6DA6B051B8A2F9A00CA6F98 /* AppStoreRating.h */, + B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */, B6FE7EB81ADD63AE00A6D22F /* NSData+ows_StripToken.h */, B6FE7EB91ADD63AE00A6D22F /* NSData+ows_StripToken.m */, A59E6D701A79E5D100D98E2E /* MIMETypeUtil.h */, @@ -2982,6 +2987,7 @@ 76EB05BA18170B33006006FC /* CommitPacket.m in Sources */, 76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */, 76EB05FC18170B33006006FC /* CallConnectUtil_Server.m in Sources */, + B6DA6B071B8A2F9A00CA6F98 /* AppStoreRating.m in Sources */, 76EB062418170B33006006FC /* PriorityQueue.m in Sources */, B6BADBE71B88D1AC0086A80D /* LockInteractionController.m in Sources */, 76EB061A18170B33006006FC /* DiscardingLog.m in Sources */, diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 0ce8d69a1..356afcc4e 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1,4 +1,5 @@ #import "AppDelegate.h" +#import "AppStoreRating.h" #import "CategorizingLogger.h" #import "ContactsManager.h" #import "DebugLogger.h" @@ -29,6 +30,10 @@ static NSString * const kURLHostVerifyPrefix = @"verify"; #pragma mark Detect updates - perform migrations ++ (void)initialize{ + [AppStoreRating setupRatingLibrary]; +} + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self setupAppearance]; [[PushManager sharedManager] registerPushKitNotificationFuture]; diff --git a/Signal/src/util/AppStoreRating.h b/Signal/src/util/AppStoreRating.h new file mode 100644 index 000000000..210a513ec --- /dev/null +++ b/Signal/src/util/AppStoreRating.h @@ -0,0 +1,15 @@ +// +// AppStoreRating.h +// Signal +// +// Created by Frederic Jacobs on 23/08/15. +// Copyright (c) 2015 Open Whisper Systems. All rights reserved. +// + +#import + +@interface AppStoreRating : NSObject + ++ (void)setupRatingLibrary; + +@end diff --git a/Signal/src/util/AppStoreRating.m b/Signal/src/util/AppStoreRating.m new file mode 100644 index 000000000..e9316360e --- /dev/null +++ b/Signal/src/util/AppStoreRating.m @@ -0,0 +1,28 @@ +// +// AppStoreRating.m +// Signal +// +// Created by Frederic Jacobs on 23/08/15. +// Copyright (c) 2015 Open Whisper Systems. All rights reserved. +// + +#import "AppStoreRating.h" +#import + +@implementation AppStoreRating + ++ (void)setupRatingLibrary +{ + iRate *rate = [iRate sharedInstance]; + rate.appStoreID = 874139669; + rate.daysUntilPrompt = 15; + rate.usesUntilPrompt = 10; + rate.remindPeriod = 20; + rate.onlyPromptIfLatestVersion = YES; + rate.promptForNewVersionIfUserRated = NO; + rate.messageTitle = NSLocalizedString(@"RATING_TITLE", nil); + rate.message = NSLocalizedString(@"RATING_MSG", nil); + rate.rateButtonLabel = NSLocalizedString(@"RATING_RATE", nil); +} + +@end diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index cee35891af133f84fd0bbd5bcb3f21b36f061b0e..c62ec8de234f97216f4be55c938069faff0ab727 100644 GIT binary patch delta 415 zcmZ9Iu}%U(5QcwR3XQSQM2#zr#u!3lr4|;3P(UJB*_iV@5QIH)E)pu9f$US*`7jp7 z!e{Z@)#5ap$^0|(&p)&C`Cj?@sJz{d)~l+it4rOerH-1bgDro4wB{R)?bA|PcWSGr zCS;=vtOmW0UntiMpUG+jUijDJy&VTKdQ_qpDn?Tk8iEr!f8E~SI4O0eWUXKAZZ3mT z@ypIp%aqCy-!sKfp&J#e0nrd#$G0M5&OEEbh#kDAICVm{h{(lVEc^tUM3ourOkoq| z>p^CzIfXGVte)Ygpd4C=3Oy6`V=H8$9HGCTOIfteY0mWTs+{lVm{+9(cH@VFLJ!q} Ks+Pn!wtoYMy-Y~} delta 9 Qcmcb2gYniC#tl(f02>el+W-In