The documentation describes the steps to integrate ActSDK into your iOS project.
This document works in 2 sections:
Visit Apple Developer Portal - https://developer.apple.com/account/resourcesand log in with your credentials.
My App VPNExtension
and bundle identifier com.mycompany.myapp.vpnExtension
(replace com.mycompany.myapp with your App’s bundle id). Enable the following on the newly created AppID.
Now that we have configured the App Store, we move to configure Xcode, import the right files and setup the right entitlements, build settings and build phases.
Note: Assume extracted folder path - /path/to/ActSDK and hereby refered as the “SDK path”; and bundle id(com.mycompany.myapp), hereby refered as bundleID
SDK/includes
: contains header filesSDK/Libs
: contains compiled librarySDK/*.m
: contains some extra files needed for compilation
Header Search Paths
add SDK path and set the search to recursive
.Framework Search Paths
add SDK path and set the search to recursive
.Library Search Paths
add SDK path and set the search to recursive
.Enable Bitcode
option to No
.
Compile Sources
add
“Link Binary With Libraries” > ‘+’ sign > “Add Other…”
, then navigate to /path/to/ActSDK/Libs
and add libactmobilemono.a
.Link Binary With Liraries
, click on the +
sign. Then in the search box, type and add the following framework libraries.
CFBundleDisplayName
in the plist is set to Your App VPN
or similar. This will show up in the Apple VPN Profiles.Capabilities
tab of your app target settings.
Capabilities
. Choose Packet Tunnel
for its capabilities.Personal VPN
.App Groups
and choose the group id that you created earlier (e.g. group.actsdk).
[ActSDK initWithToken:NSString forVPN:BOOL];
[ActSDK startProxy];
[ActSDK setOnDemandAllowed:BOOL];
// enables the on-Demand feature, default is false - set it to false when not intending to do so.
[ActSDK setVPNServerName:@"vpn.sdk.sample"];
[ActSDK initVpnWithOnDemand:BOOL withCompletion:];
// default bool value is false
[ActSDK setDelegate:UIViewController];
If you want to override/have your own PacketTunnelProvider.m-
[ActSDK getRegionsIncludingAliases:YES];
// region hostnames - dns name
[ActSDK getRegionLabelsIncludingAliases:YES];
// region labels - human friendly location names
[ActSDK changeRegion:NSString];
// // region hostname
[[NSUserDefaults standardUserDefaults] setValue:NSString forKey:@"selected_accel_label"];
// region label name
[ActSDK connectVPNwithCompletion:];
[ActSDK disconnectVPNwithCompletion:];
[ActSDK getVPNStatus];
// returns current NEVPNStatus
[ActSDK registerForVpnStatusChange:id withMethodSelector:SELECTOR];
// register a listener for when VPN status changes
ActSDK.h
, ActProxyURLProtocol.h
and NSURLProtocol+WKWebViewSupport.h
header files.
#import "ActSDK.h" #import "ActProxyURLProtocol.h" #import "NSURLProtocol+WKWebViewSupport.h"
[NSURLProtocol wk_registerScheme:@"http"]; [NSURLProtocol wk_registerScheme:@"https"];
[NSURLProtocol registerClass:[ActProxyURLProtocol class]];
// turns the proxy on
[NSURLProtocol unregisterClass:[ActProxyURLProtocol class]];// turns the proxy off