ソースを参照

Add isRunningTestFlight

Marino Faggiana 8 年 前
コミット
917d01f534
3 ファイル変更12 行追加0 行削除
  1. 3 0
      iOSClient/AppDelegate.h
  2. 5 0
      iOSClient/AppDelegate.m
  3. 4 0
      iOSClient/Main/CCMain.m

+ 3 - 0
iOSClient/AppDelegate.h

@@ -52,6 +52,9 @@
 @interface AppDelegate : UIResponder <UIApplicationDelegate, BKPasscodeLockScreenManagerDelegate, BKPasscodeViewControllerDelegate, LMMediaPlayerViewDelegate, TWMessageBarStyleSheet>
 #endif
 
+// For debug
+@property BOOL isRunningTestFlight;
+
 // For LMMediaPlayerView
 @property (strong, nonatomic) UIWindow *window;
 

+ 5 - 0
iOSClient/AppDelegate.m

@@ -87,6 +87,11 @@
     [MagicalRecord setLoggingLevel:MagicalRecordLoggingLevelOff];
 #endif
     
+    //
+    NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
+    NSString *receiptURLString = [receiptURL path];
+    _isRunningTestFlight =  ([receiptURLString rangeOfString:@"sandboxReceipt"].location != NSNotFound);
+    
     // Verify upgrade
     [self upgrade];
     

+ 4 - 0
iOSClient/Main/CCMain.m

@@ -323,6 +323,10 @@
         [app loadTableAutomaticUploadForSelector:selectorUploadAutomatic];
         [app loadTableAutomaticUploadForSelector:selectorUploadAutomaticAll];
         
+        // message TestFlight
+        if (app.isRunningTestFlight)
+            [app messageNotification:@"_info_" description:@"This version is beta and only fot TestFlight, send report at ios@nextcloud.com" visible:YES delay:dismissAfterSecond type:TWMessageBarMessageTypeInfo];
+        
     } else {
         
         // reload datasource