Post

Replies

Boosts

Views

Activity

Sample App for iOS CryptoTokenKit?
Xcode 12 doesn't have a template for adding a CryptoTokenKit extension. When I work around this and add my own based off of MacOS I can get my project to build but when I try to run the app on iOS 14, Xcode says Unable to install "***" The console log for iOS says this (may not be related): trustd[158]/1#8 LF=0 copyparentcertificates Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements} I have Xcode signing my extension and adding as Embed without signing under Frameworks...
3
0
1.1k
Jul ’20
javascript promise
I am attempting to return a javascript promise from an Obj-c class, but the promise returned in the script always appears undefined. Is valueWithNewPromiseInContext supported in UIWebView or only in WKWebView?My class has a JSExport protocol:@protocol TestMe <JSExport>- (void)test:(JSValue*)testID;@end@interface TestMe : NSObject <WebAuthN>+ (void)installInContext:(JSContext*)context;- (JSValue*)test:(JSValue*)testID;@endMy test method:- (JSValue *)test:(JSValue*)testID { if (@available(iOS 13.0, *)) { return [JSValue valueWithNewPromiseInContext:_jsContext fromExecutor:^(JSValue *fulfill, JSValue *reject) { LogDebug("PKWebAuthN newPromise fulfill(%@) reject(%@)\n", fulfill, reject); // test fulfill dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ JSValue *v = [JSValue valueWithObject:@"success" inContext:self->_jsContext]; [fulfill callWithArguments:@[v]]; }); }]; } else { _jsContext.exception = [JSValue valueWithNewErrorFromMessage:@"webauthn not supported by this iOS version" inContext:_jsContext]; return [JSValue valueWithUndefinedInContext:_jsContext]; }}I successfully get my TestMe object added to the javascript JSContext (my test: method does get called from javascript)In my web page javascript, I create the object: function testme(testNumber) { var testit = new TestMe(); let testpromise = testit.test(testNumber); document.getElementById("testit").innerHTML = "testpromise: " + testpromise; console.log("testpromise: " + testpromise);// testpromise is always undefined here!!! try { testpromise.then( function fulfilled(arg){ document.getElementById("testit").innerHTML = "fulfilled: " + arg; console.log("fulfilled: " + arg); webauthn = nil; }, function rejected(err) { document.getElementById("testit").innerHTML = "rejected: " + arg; console.log("rejected: " + err); webauthn = nil; } ); } catch(err) { console.log("caught error from testpromise: " + err); webauthn = nil; } }Where I call testit.test, the value testpromise is always undefined instead of being the promise returned from my ObjC class.My web view is UIWebView and not WKWebView
0
0
667
Mar ’20