mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-17 20:08:31 +00:00
Assistant: fix remote provisioning
This commit is contained in:
parent
b236f498c7
commit
ac0aacb26c
7 changed files with 42 additions and 43 deletions
|
|
@ -40,14 +40,14 @@
|
|||
@property(nonatomic, strong) IBOutlet UIView *createAccountActivationView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *linphoneLoginView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *loginView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *remoteProvisionningLoginView;
|
||||
@property(strong, nonatomic) IBOutlet UIView *remoteProvisionningView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *remoteProvisioningLoginView;
|
||||
@property(strong, nonatomic) IBOutlet UIView *remoteProvisioningView;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *welcomeLogoImage;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *gotoCreateAccountButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *gotoLinphoneLoginButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *gotoLoginButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *gotoRemoteProvisionningButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *gotoRemoteProvisioningButton;
|
||||
|
||||
- (void)reset;
|
||||
- (void)fillDefaultValues;
|
||||
|
|
@ -58,14 +58,14 @@
|
|||
- (IBAction)onGotoCreateAccountClick:(id)sender;
|
||||
- (IBAction)onGotoLinphoneLoginClick:(id)sender;
|
||||
- (IBAction)onGotoLoginClick:(id)sender;
|
||||
- (IBAction)onGotoRemoteProvisionningClick:(id)sender;
|
||||
- (IBAction)onGotoRemoteProvisioningClick:(id)sender;
|
||||
|
||||
- (IBAction)onCreateAccountClick:(id)sender;
|
||||
- (IBAction)onCreateAccountActivationClick:(id)sender;
|
||||
- (IBAction)onLinphoneLoginClick:(id)sender;
|
||||
- (IBAction)onLoginClick:(id)sender;
|
||||
- (IBAction)onRemoteProvisionningLoginClick:(id)sender;
|
||||
- (IBAction)onRemoteProvisionningDownloadClick:(id)sender;
|
||||
- (IBAction)onRemoteProvisioningLoginClick:(id)sender;
|
||||
- (IBAction)onRemoteProvisioningDownloadClick:(id)sender;
|
||||
|
||||
- (IBAction)onTransportChange:(id)sender;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[LinphoneUtils adjustFontSize:_linphoneLoginView mult:2.22f];
|
||||
[LinphoneUtils adjustFontSize:_loginView mult:2.22f];
|
||||
[LinphoneUtils adjustFontSize:_createAccountActivationView mult:2.22f];
|
||||
[LinphoneUtils adjustFontSize:_remoteProvisionningLoginView mult:2.22f];
|
||||
[LinphoneUtils adjustFontSize:_remoteProvisioningLoginView mult:2.22f];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
}
|
||||
|
||||
[self changeView:_remoteProvisionningLoginView back:FALSE animation:TRUE];
|
||||
[self changeView:_remoteProvisioningLoginView back:FALSE animation:TRUE];
|
||||
|
||||
linphone_proxy_config_destroy(default_conf);
|
||||
}
|
||||
|
|
@ -346,7 +346,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[AssistantView cleanTextField:_linphoneLoginView];
|
||||
[AssistantView cleanTextField:_loginView];
|
||||
[AssistantView cleanTextField:_createAccountActivationView];
|
||||
[AssistantView cleanTextField:_remoteProvisionningLoginView];
|
||||
[AssistantView cleanTextField:_remoteProvisioningLoginView];
|
||||
}
|
||||
|
||||
- (void)displayUsernameAsPhoneOrUsername {
|
||||
|
|
@ -455,18 +455,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}];
|
||||
|
||||
UIAssistantTextField *url = [self findTextField:ViewElement_URL];
|
||||
[url showError:NSLocalizedString(@"Invalid remote provisionning URL", nil)
|
||||
when:^BOOL(NSString *inputEntry) {
|
||||
NSString *url = [self findTextField:ViewElement_URL].text;
|
||||
if (url.length > 0) {
|
||||
// missing prefix will result in http:// being used
|
||||
if ([url rangeOfString:@"://"].location == NSNotFound) {
|
||||
url = [NSString stringWithFormat:@"http://%@", url];
|
||||
}
|
||||
return (linphone_core_set_provisioning_uri([LinphoneManager getLc], [url UTF8String]) != 0);
|
||||
}
|
||||
return TRUE;
|
||||
}];
|
||||
[url showError:NSLocalizedString(@"Invalid remote provisioning URL", nil)
|
||||
when:^BOOL(NSString *inputEntry) {
|
||||
if (inputEntry.length > 0) {
|
||||
// missing prefix will result in http:// being used
|
||||
if ([inputEntry rangeOfString:@"://"].location == NSNotFound) {
|
||||
inputEntry = [NSString stringWithFormat:@"http://%@", inputEntry];
|
||||
}
|
||||
return (linphone_core_set_provisioning_uri([LinphoneManager getLc], inputEntry.UTF8String) != 0);
|
||||
}
|
||||
return TRUE;
|
||||
}];
|
||||
|
||||
[self shouldEnableNextButton];
|
||||
}
|
||||
|
|
@ -647,8 +646,8 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun
|
|||
[self loadAssistantConfig:@"assistant_external_sip.rc"];
|
||||
}
|
||||
|
||||
- (IBAction)onGotoRemoteProvisionningClick:(id)sender {
|
||||
nextView = _remoteProvisionningView;
|
||||
- (IBAction)onGotoRemoteProvisioningClick:(id)sender {
|
||||
nextView = _remoteProvisioningView;
|
||||
[self loadAssistantConfig:@"assistant_remote.rc"];
|
||||
[self findTextField:ViewElement_URL].text =
|
||||
[[LinphoneManager instance] lpConfigStringForKey:@"config-uri" forSection:@"misc"];
|
||||
|
|
@ -674,13 +673,13 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun
|
|||
[self addProxyConfig:linphone_account_creator_configure(account_creator)];
|
||||
}
|
||||
|
||||
- (IBAction)onRemoteProvisionningLoginClick:(id)sender {
|
||||
- (IBAction)onRemoteProvisioningLoginClick:(id)sender {
|
||||
_waitView.hidden = NO;
|
||||
[[LinphoneManager instance] lpConfigSetInt:1 forKey:@"transient_provisioning" forSection:@"misc"];
|
||||
[self addProxyConfig:linphone_account_creator_configure(account_creator)];
|
||||
}
|
||||
|
||||
- (IBAction)onRemoteProvisionningDownloadClick:(id)sender {
|
||||
- (IBAction)onRemoteProvisioningDownloadClick:(id)sender {
|
||||
[_waitView setHidden:false];
|
||||
[self resetLiblinphone];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
<outlet property="gotoCreateAccountButton" destination="36" id="bZf-lI-yJp"/>
|
||||
<outlet property="gotoLinphoneLoginButton" destination="38" id="K1E-r5-WiL"/>
|
||||
<outlet property="gotoLoginButton" destination="39" id="uSY-cr-j4w"/>
|
||||
<outlet property="gotoRemoteProvisionningButton" destination="Kbn-dL-C5h" id="pgT-y6-qKj"/>
|
||||
<outlet property="gotoRemoteProvisioningButton" destination="Kbn-dL-C5h" id="zLh-uO-x8P"/>
|
||||
<outlet property="linphoneLoginView" destination="52" id="9NX-6W-50g"/>
|
||||
<outlet property="loginView" destination="56" id="bJH-N8-uPi"/>
|
||||
<outlet property="remoteProvisionningLoginView" destination="xVK-hL-6pe" id="P3u-Oo-Hzd"/>
|
||||
<outlet property="remoteProvisionningView" destination="Zuh-Sd-pcd" id="qQP-F4-FMX"/>
|
||||
<outlet property="remoteProvisioningLoginView" destination="xVK-hL-6pe" id="pKL-9M-Vsa"/>
|
||||
<outlet property="remoteProvisioningView" destination="Zuh-Sd-pcd" id="3pa-2M-5Xq"/>
|
||||
<outlet property="welcomeView" destination="33" id="46a-AR-5mN"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
<action selector="onGotoLinphoneLoginClick:" destination="-1" eventType="touchUpInside" id="4AG-ng-fIB"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="wordWrap" id="Kbn-dL-C5h" userLabel="remoteProvisionningButton" customClass="UIRoundBorderedButton">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="wordWrap" id="Kbn-dL-C5h" userLabel="remoteProvisioningButton" customClass="UIRoundBorderedButton">
|
||||
<rect key="frame" x="40" y="466" width="299" height="71"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
<color key="titleColor" red="0.72549019609999998" green="0.76862745099999996" blue="0.79607843140000001" alpha="1" colorSpace="deviceRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onGotoRemoteProvisionningClick:" destination="-1" eventType="touchUpInside" id="amN-4O-i2X"/>
|
||||
<action selector="onGotoRemoteProvisioningClick:" destination="-1" eventType="touchUpInside" id="cAo-3u-yUT"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="wordWrap" id="39" userLabel="loginButton" customClass="UIRoundBorderedButton">
|
||||
|
|
@ -629,7 +629,7 @@
|
|||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="626.5" y="862"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" id="Zuh-Sd-pcd" userLabel="remoteProvisionningView">
|
||||
<view contentMode="scaleToFill" id="Zuh-Sd-pcd" userLabel="remoteProvisioningView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="562"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
|
|
@ -643,7 +643,7 @@
|
|||
<nil key="highlightedColor"/>
|
||||
<size key="shadowOffset" width="-1" height="-1"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Please enter your provisionning URL" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" minimumFontSize="10" id="hEy-Xe-afq" userLabel="subtitleLabel">
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Please enter your provisioning URL" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" minimumFontSize="10" id="hEy-Xe-afq" userLabel="subtitleLabel">
|
||||
<rect key="frame" x="36" y="100" width="302" height="29"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
|
|
@ -666,7 +666,7 @@
|
|||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" red="0.88235294119999996" green="0.88235294119999996" blue="0.88235294119999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Username"/>
|
||||
<accessibility key="accessibilityConfiguration" label="URL"/>
|
||||
<color key="textColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="URL"/>
|
||||
|
|
@ -675,7 +675,7 @@
|
|||
<outlet property="errorLabel" destination="uEq-Gk-9iy" id="OLx-QW-CcR"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<label opaque="NO" userInteractionEnabled="NO" tag="410" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Invalid username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="uEq-Gk-9iy" userLabel="urlErrorLabel">
|
||||
<label opaque="NO" userInteractionEnabled="NO" tag="410" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Invalid URL" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="uEq-Gk-9iy" userLabel="urlErrorLabel">
|
||||
<rect key="frame" x="38" y="217" width="299" height="10"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
|
|
@ -698,7 +698,7 @@
|
|||
<color key="titleColor" red="0.76862745099999996" green="0.76862745099999996" blue="0.76862745099999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onRemoteProvisionningDownloadClick:" destination="-1" eventType="touchUpInside" id="P1f-AL-8Xt"/>
|
||||
<action selector="onRemoteProvisioningDownloadClick:" destination="-1" eventType="touchUpInside" id="6yF-1w-Hpa"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
|
|
@ -708,7 +708,7 @@
|
|||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="209.5" y="1470"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" id="xVK-hL-6pe" userLabel="remoteProvisionningLoginView">
|
||||
<view contentMode="scaleToFill" id="xVK-hL-6pe" userLabel="remoteProvisioningLoginView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="562"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
|
|
@ -795,7 +795,7 @@
|
|||
<outlet property="delegate" destination="-1" id="6Mx-mR-LQx"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button opaque="NO" tag="130" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="eKs-or-rqw" userLabel="remoteProvisionningLoginButton" customClass="UIRoundBorderedButton">
|
||||
<button opaque="NO" tag="130" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="eKs-or-rqw" userLabel="remoteProvisioningLoginButton" customClass="UIRoundBorderedButton">
|
||||
<rect key="frame" x="38" y="448" width="299" height="71"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
|
|
@ -810,7 +810,7 @@
|
|||
<color key="titleColor" red="0.76862745099999996" green="0.76862745099999996" blue="0.76862745099999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onRemoteProvisionningLoginClick:" destination="-1" eventType="touchUpInside" id="11g-KH-emH"/>
|
||||
<action selector="onRemoteProvisioningLoginClick:" destination="-1" eventType="touchUpInside" id="smy-BN-mwN"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ typedef BOOL (^UIDisplayError)(NSString *inputEntry);
|
|||
|
||||
@property(nonatomic, strong) IBOutlet UILabel *errorLabel;
|
||||
@property(nonatomic, readonly) UIDisplayError showErrorPredicate;
|
||||
@property(nonatomic, readonly) NSString *lastText;
|
||||
@property(nonatomic, strong) NSString *lastText;
|
||||
// we should show error only when user finished editted the field at least once
|
||||
@property(atomic) BOOL canShowError;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
[tester fail];
|
||||
} else {
|
||||
[tester tapViewWithAccessibilityLabel:@"OK"]; // alertview
|
||||
[tester tapViewWithAccessibilityLabel:@"Cancel"]; // cancel assistant
|
||||
[tester tapViewWithAccessibilityLabel:@"Dialer"];
|
||||
}
|
||||
} else {
|
||||
[tester fail];
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
|
||||
- (void)testRemoteProvisioning {
|
||||
[tester tapViewWithAccessibilityLabel:@"Fetch remote configuration"];
|
||||
[tester enterText:@"smtp.linphone.org/testios_xml" intoViewWithAccessibilityLabel:@"Username"];
|
||||
[tester enterText:@"smtp.linphone.org/testios_xml" intoViewWithAccessibilityLabel:@"URL"];
|
||||
[tester tapViewWithAccessibilityLabel:@"Fetch and apply"];
|
||||
[self waitForRegistration];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
[super beforeAll];
|
||||
[self switchToValidAccountIfNeeded];
|
||||
// turn off logs for chat tests because there are way to much logs in liblinphone in filetransfer and sqlite
|
||||
// linphone_core_set_log_level(ORTP_WARNING);
|
||||
linphone_core_set_log_level(ORTP_WARNING);
|
||||
}
|
||||
|
||||
- (void)beforeEach {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 53dcc192fd1fb9cefb8d083cb488a8b3b8bb5a92
|
||||
Subproject commit 8c2a440fd9804ea3dacd27737afd3f18911e0379
|
||||
Loading…
Add table
Reference in a new issue