Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 008a5e9

Browse files
author
Rad Azzouz
committed
Merge pull request #203 from AgileBits/task/more-readme-improvements-1
More README improvements
2 parents 259aeb0 + fc3c845 commit 008a5e9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Demos/WebView Demo for iOS/WebView Demo for iOS/WebViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ - (void)viewDidLoad {
4242
- (IBAction)fillUsing1Password:(id)sender {
4343
[[OnePasswordExtension sharedExtension] fillItemIntoWebView:self.webView forViewController:self sender:sender showOnlyLogins:NO completion:^(BOOL success, NSError *error) {
4444
if (!success) {
45-
NSLog(@"Failed to fill login in webview: <%@>", error);
45+
NSLog(@"Failed to fill into webview: <%@>", error);
4646
}
4747
}];
4848
}

OnePasswordExtension.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ - (void)fillItemIntoWebView:(id)webView forViewController:(UIViewController *)vi
219219

220220
#ifdef __IPHONE_8_0
221221
if ([webView isKindOfClass:[UIWebView class]]) {
222-
[self fillLoginIntoUIWebView:webView webViewController:viewController sender:(id)sender showOnlyLogins:yesOrNo completion:^(BOOL success, NSError *error) {
222+
[self fillItemIntoUIWebView:webView webViewController:viewController sender:(id)sender showOnlyLogins:yesOrNo completion:^(BOOL success, NSError *error) {
223223
if (completion) {
224224
completion(success, error);
225225
}
226226
}];
227227
}
228228
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
229229
else if ([webView isKindOfClass:[WKWebView class]]) {
230-
[self fillLoginIntoWKWebView:webView forViewController:viewController sender:(id)sender showOnlyLogins:yesOrNo completion:^(BOOL success, NSError *error) {
230+
[self fillItemIntoWKWebView:webView forViewController:viewController sender:(id)sender showOnlyLogins:yesOrNo completion:^(BOOL success, NSError *error) {
231231
if (completion) {
232232
completion(success, error);
233233
}
@@ -383,7 +383,7 @@ - (void)findLoginIn1PasswordWithURLString:(NSString *)URLString collectedPageDet
383383
}
384384

385385
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
386-
- (void)fillLoginIntoWKWebView:(WKWebView *)webView forViewController:(UIViewController *)viewController sender:(id)sender showOnlyLogins:(BOOL)yesOrNo completion:(void (^)(BOOL success, NSError *error))completion {
386+
- (void)fillItemIntoWKWebView:(WKWebView *)webView forViewController:(UIViewController *)viewController sender:(id)sender showOnlyLogins:(BOOL)yesOrNo completion:(void (^)(BOOL success, NSError *error))completion {
387387
[webView evaluateJavaScript:OPWebViewCollectFieldsScript completionHandler:^(NSString *result, NSError *error) {
388388
if (!result) {
389389
NSLog(@"1Password Extension failed to collect web page fields: %@", error);
@@ -403,7 +403,7 @@ - (void)fillLoginIntoWKWebView:(WKWebView *)webView forViewController:(UIViewCon
403403
}
404404
#endif
405405

406-
- (void)fillLoginIntoUIWebView:(UIWebView *)webView webViewController:(UIViewController *)viewController sender:(id)sender showOnlyLogins:(BOOL)yesOrNo completion:(void (^)(BOOL success, NSError *error))completion {
406+
- (void)fillItemIntoUIWebView:(UIWebView *)webView webViewController:(UIViewController *)viewController sender:(id)sender showOnlyLogins:(BOOL)yesOrNo completion:(void (^)(BOOL success, NSError *error))completion {
407407
NSString *collectedPageDetails = [webView stringByEvaluatingJavaScriptFromString:OPWebViewCollectFieldsScript];
408408
[self findLoginIn1PasswordWithURLString:webView.request.URL.absoluteString collectedPageDetails:collectedPageDetails forWebViewController:viewController sender:sender withWebView:webView showOnlyLogins:yesOrNo completion:^(BOOL success, NSError *error) {
409409
if (completion) {

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Add the `OnePasswordExtension.h`, `OnePasswordExtension.m`, and `1Password.xcass
8080

8181
### Use Case #1: Native App Login
8282

83-
In this use case we'll learn how to enable your existing users to fill their credentials into your native app's login form. If your application is using a web view to login (i.e. OAuth), you'll want to follow the web view integration steps in [Use Case #4: Web View Login Support](https://github.com/AgileBits/onepassword-app-extension#use-case-4-web-view-login-support).
83+
In this use case we'll learn how to enable your existing users to fill their credentials into your native app's login form. If your application is using a web view to login (i.e. OAuth), you'll want to follow the web view integration steps in [Use Case #4: Web View Filling Support](https://github.com/AgileBits/onepassword-app-extension#use-case-4-web-view-filling-support).
8484

8585
The first step is to add a UIButton to your login page. Use an existing 1Password image from the _1Password.xcassets_ catalog so users recognize the button.
8686

@@ -211,7 +211,7 @@ Adding 1Password to your change password screen is very similar to adding 1Passw
211211
}
212212
```
213213

214-
### Use Case #4: Web View Login Support
214+
### Use Case #4: Web View Filling Support
215215

216216
The 1Password App Extension is not limited to filling native UIs. With just a little bit of extra effort, users can fill `UIWebView`s and `WKWebView`s within your application as well.
217217

@@ -221,7 +221,7 @@ Simply add a button to your UI with its action assigned to this method in your w
221221
- (IBAction)fillUsing1Password:(id)sender {
222222
[[OnePasswordExtension sharedExtension] fillItemIntoWebView:self.webView forViewController:self sender:sender showOnlyLogins:NO completion:^(BOOL success, NSError *error) {
223223
if (!success) {
224-
NSLog(@"Failed to fill login in webview: <%@>", error);
224+
NSLog(@"Failed to fill into webview: <%@>", error);
225225
}
226226
}];
227227
}

0 commit comments

Comments
 (0)