Skip to content

Commit

Permalink
Ios custom flow (#12920)
Browse files Browse the repository at this point in the history
* Custom Commissioning Flow Outbound

Outbound work flow

* Custom Commissioning Flow Inbound

* Fix comments

* remove autoresize.

* Remove duplicate vars and fixed re-scan logic

* Extra clean up and adds some logs

* Remove dev params

* Delete project.pbxproj

* Revert "Delete project.pbxproj"

This reverts commit eb7636f.

* Update project.pbxproj

* Update project.pbxproj

* adds a feature flag CommissioningCustomFlowUseMockFlag

CommissioningCustomFlowUseMockFlag = 1, use mock respond
CommissioningCustomFlowUseMockFlag = 0, use api respond

* Optimized UI while reading from Ledger API.

* Remove some log

* Restyled by whitespace

* Restyled by clang-format

* Update Info.plist

* Adds a pop up window while redirecting back

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 26, 2022
1 parent e0707e6 commit 6845303
Show file tree
Hide file tree
Showing 3 changed files with 297 additions and 35 deletions.
20 changes: 20 additions & 0 deletions src/darwin/CHIPTool/CHIPTool/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,28 @@
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>mt</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSEnvironment</key>
<dict>
<key>CommissioningCustomFlowLedgerUrl</key>
<string>https://dcl.dev.dsr-corporation.com/api/modelinfo/models</string>
<key>CommissioningCustomFlowReturnUrl</key>
<string>mt://modelinfo?payload</string>
<key>CommissioningCustomFlowUseMockFlag</key>
<true/>
</dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NFCReaderUsageDescription</key>
Expand Down
15 changes: 15 additions & 0 deletions src/darwin/CHIPTool/CHIPTool/View Controllers/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[self.window makeKeyAndVisible];
return YES;
}

- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
// custom commissioning flow
UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"Info"
message:@"Commissioning flow Completed."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction * ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil];
[alert addAction:ok];
[self.window.rootViewController presentViewController:alert animated:YES completion:nil];
NSLog(@"Do custom commissioning inbound logic here.");
return YES;
}
@end
Loading

0 comments on commit 6845303

Please sign in to comment.