Browse Source

Merge pull request #334 from adam-p/master

Resolve all TODO questions in iOS library
Adam Pritchard 9 years ago
parent
commit
4cc934b213

+ 8 - 9
MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.h

@@ -64,11 +64,8 @@ FOUNDATION_EXPORT const unsigned char PsiphonTunnelVersionString[];
  - `ClientPlatform`: Should not be set by most library consumers.
  - `ClientPlatform`: Should not be set by most library consumers.
  - `UpstreamProxyUrl`
  - `UpstreamProxyUrl`
  - `EmitDiagnosticNotices`
  - `EmitDiagnosticNotices`
- - `LocalHttpProxyPort` // TODO: Should this be set-able for iOS?
- - `LocalSocksProxyPort` // TODO: Should this be set-able for iOS?
  - `EgressRegion`
  - `EgressRegion`
  - `EstablishTunnelTimeoutSeconds`
  - `EstablishTunnelTimeoutSeconds`
- - `TunnelWholeDevice`: For stats purposes, but must be accurate. Defaults to 0 (false).
  - Should only be set if the Psiphon library is handling upgrade downloading (which it usually is _not_):
  - Should only be set if the Psiphon library is handling upgrade downloading (which it usually is _not_):
    - `UpgradeDownloadUrl`
    - `UpgradeDownloadUrl`
    - `UpgradeDownloadClientVersionHeader`
    - `UpgradeDownloadClientVersionHeader`
@@ -82,6 +79,11 @@ FOUNDATION_EXPORT const unsigned char PsiphonTunnelVersionString[];
    - `PsiphonApiServerTimeoutSeconds`
    - `PsiphonApiServerTimeoutSeconds`
    - `FetchRoutesTimeoutSeconds`
    - `FetchRoutesTimeoutSeconds`
    - `HttpProxyOriginServerTimeoutSeconds`
    - `HttpProxyOriginServerTimeoutSeconds`
+ - Fields which should only be set by Psiphon proper:
+   - `LocalHttpProxyPort`
+   - `LocalSocksProxyPort`
+   - `TunnelWholeDevice`: For stats purposes, but must be accurate. Defaults to 0 (false).
+
  @endcode
  @endcode
 
 
  @note All other config fields must not be set.
  @note All other config fields must not be set.
@@ -203,34 +205,31 @@ FOUNDATION_EXPORT const unsigned char PsiphonTunnelVersionString[];
  */
  */
 - (void)onBytesTransferred:(int64_t)sent :(int64_t)received;
 - (void)onBytesTransferred:(int64_t)sent :(int64_t)received;
 
 
-// TODO: Only applicable to Psiphon proper?
 /*!
 /*!
  Called when tunnel-core discovers a home page associated with this client.
  Called when tunnel-core discovers a home page associated with this client.
  If there are no home pages, it will not be called. May be called more than
  If there are no home pages, it will not be called. May be called more than
  once, for multiple home pages.
  once, for multiple home pages.
+ Note: This is probably only applicable to Psiphon Inc.'s apps.
  @param url  The URL of the home page.
  @param url  The URL of the home page.
  Swift: @code func onHomepage(_ url: String) @endcode
  Swift: @code func onHomepage(_ url: String) @endcode
  */
  */
 - (void)onHomepage:(NSString * _Nonnull)url;
 - (void)onHomepage:(NSString * _Nonnull)url;
 
 
-// TODO: Only applicable to Psiphon proper?
 /*!
 /*!
  Called if the current version of the client is the latest (i.e., there is no upgrade available).
  Called if the current version of the client is the latest (i.e., there is no upgrade available).
+ Note: This is probably only applicable to Psiphon Inc.'s apps.
  Swift: @code func onClientIsLatestVersion() @endcode
  Swift: @code func onClientIsLatestVersion() @endcode
  */
  */
 - (void)onClientIsLatestVersion;
 - (void)onClientIsLatestVersion;
 
 
-// TODO: Only applicable to Psiphon proper?
 /*!
 /*!
  Called when a client upgrade has been downloaded.
  Called when a client upgrade has been downloaded.
  @param filename  The name of the file containing the upgrade.
  @param filename  The name of the file containing the upgrade.
+ Note: This is probably only applicable to Psiphon Inc.'s apps.
  Swift: @code func onClientUpgradeDownloaded(_ filename: String) @endcode
  Swift: @code func onClientUpgradeDownloaded(_ filename: String) @endcode
  */
  */
 - (void)onClientUpgradeDownloaded:(NSString * _Nonnull)filename;
 - (void)onClientUpgradeDownloaded:(NSString * _Nonnull)filename;
 
 
-// TODO: Applies to iOS?
-//func onClientVerificationRequired(nonce: String, ttlSeconds: Int, resetCache: Bool)
-
 @end
 @end
 
 
 /*!
 /*!

+ 0 - 4
MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m

@@ -280,13 +280,10 @@
     // * UpgradeDownloadFilename
     // * UpgradeDownloadFilename
     // * timeout fields
     // * timeout fields
     
     
-    // TODO: Is LocalSocksProxyPort relevant for iOS?
-    
     //
     //
     // Fill in the rest of the values.
     // Fill in the rest of the values.
     //
     //
     
     
-    // TODO: Should be configurable?
     config[@"EmitBytesTransferred"] = [NSNumber numberWithBool:TRUE];
     config[@"EmitBytesTransferred"] = [NSNumber numberWithBool:TRUE];
 
 
     config[@"DeviceRegion"] = [PsiphonTunnel getDeviceRegion];
     config[@"DeviceRegion"] = [PsiphonTunnel getDeviceRegion];
@@ -309,7 +306,6 @@
     // Some of them require default values.
     // Some of them require default values.
     //
     //
     
     
-    // TODO: After updating tunnel-core in the framework, verify that this value is getting through to Kibana.
     if (config[@"ClientPlatform"] == nil) {
     if (config[@"ClientPlatform"] == nil) {
         config[@"ClientPlatform"] = @"iOS-Library";
         config[@"ClientPlatform"] = @"iOS-Library";
     }
     }