FBTouchIDCommands.m 889 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import "FBTouchIDCommands.h"
  10. #import "FBRouteRequest.h"
  11. #import "XCUIDevice+FBHelpers.h"
  12. @implementation FBTouchIDCommands
  13. + (NSArray *)routes
  14. {
  15. return @[
  16. [[FBRoute POST:@"/wda/touch_id"] respondWithBlock: ^ id<FBResponsePayload> (FBRouteRequest *request) {
  17. BOOL isMatch = [request.arguments[@"match"] boolValue];
  18. if (![[XCUIDevice sharedDevice] fb_fingerTouchShouldMatch:isMatch]) {
  19. return FBResponseWithUnknownErrorFormat(@"Cannot perform Touch Id %@match", isMatch ? @"" : @"non-");
  20. }
  21. return FBResponseWithOK();
  22. }],
  23. ];
  24. }
  25. @end