Posts

Post not yet marked as solved
3 Replies
538 Views
Hi,I'm trying to get Handoff from a WatchKit app to an iOS app to work (again). It probably worked in the past with the older notification APIs.I validated Watch -> iPhone handoff works with some Apple supplied Apps.However when I open in our app the notification on the watch, nothing is shown on the iPhone (app switch..) screen.The Watchkit handoff code below is executed and no error is logged on the console- (void)willActivate { // This method is called when watch view controller is about to be visible to user [super willActivate]; [self startHandoff]; // ... } - (void)startHandoff { NSString *documentURL = self.news.url; NSLog(@"updating user activity to %@", documentURL); if (@available(watchOS 5.0, *)) { NSUserActivity *activity = [[NSUserActivity alloc] initWithActivityType:USER_ACTIVITY_TYPE]; activity.userInfo = @{HAND_OFF_DOCUMENT_URL_KEY : documentURL}; activity.title = self.news.headline; activity.eligibleForHandoff = YES; activity.needsSave = YES; // activity.targetContentIdentifier = documentURL; activity.requiredUserInfoKeys = [NSSet setWithObject:HAND_OFF_DOCUMENT_URL_KEY]; [self updateUserActivity:activity]; [activity becomeCurrent]; } else { // Fallback on earlier versions [self updateUserActivity:USER_ACTIVITY_TYPE userInfo:@{HAND_OFF_DOCUMENT_URL_KEY : documentURL} webpageURL:nil]; } }Originally the iOS App had the USER_ACTIVITY_TYPE just registered in the Info.plist under the NSUserActivityTypes key.I also added for testing code when registering the (working) push notification handler:- (void)registerForPushNotifications { UNNotificationCategory *newDocumentCategory = [UNNotificationCategory categoryWithIdentifier:PUSH_NOTIFICATION_TYPE actions:@[] // Default action is sufficient intentIdentifiers:@[] // SiriKit only options:UNNotificationCategoryOptionNone]; // UNNotificationCategoryOptionAllowAnnouncement UNNotificationCategory *handoverCategory = [UNNotificationCategory categoryWithIdentifier:USER_ACTIVITY_TYPE actions:@[] // Default action is sufficient intentIdentifiers:@[] // SiriKit only UNUserNotificationCenter *nc = [UNUserNotificationCenter currentNotificationCenter]; [nc setNotificationCategories:[NSSet setWithArray:@[newDocumentCategory, handoverCategory] ]]; [nc requestAuthorizationWithOptions:UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert completionHandler:^( BOOL granted, NSError *__nullable error ){ options:UNNotificationCategoryOptionNone];Any hints how I can debug?
Posted
by Thomas E..
Last updated
.
Post not yet marked as solved
2 Replies
796 Views
Hi,when I run my iOS app with thread sanitizer enabled I get tons of data race warnings when accessing an singleton:+ (SessionContext *)sharedSessionContext { static SessionContext *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[SessionContext alloc] initSingleton]; }); return sharedInstance; }I can't spot the difference of the code above to the proposed pattern from WWDC 2016 session 412 (besides the usage of a function instead of a class function):Singleton *getSingleton() { static dispatch_once_t predicate; dispatch_once(&predicate, ^{ sharedInstance = [[self alloc] init]; }); return sharedInstance; }Error log:file:///Sources/***/Common/Context/SessionContext.m: runtime: Threading Issues: Data race in +[SessionContext sharedSessionContext] at __llvm_gcov_ctr.2583notice: Threading Issues: '__llvm_gcov_ctr.2583' is a global variable (0x10db63af8)Write of size 8 by thread 4#0 0x0000000108155267 in +[SessionContext sharedSessionContext] at /Sources/***/Common/Context/SessionContext.m:157#1 0x0000000107504b05 in __43-[LogonController loadData:]_block_invoke at /Sources/***//LogonController:288#2 0x00000001100d589c in __tsan::invoke_and_release_block(void*) ()#3 0x000000011aa9edb5 in _dispatch_client_callout ()Write of size 8 by thread 15#0 0x0000000108155267 in +[SessionContext sharedSessionContext] at Sources/***/Common/Context/SessionContext.m:157#1 0x000000010688aa84 in -[TitleView loadLogoLoggedIn] at /Sources/***/TitleView.m:260
Posted
by Thomas E..
Last updated
.
Post not yet marked as solved
1 Replies
407 Views
Hi,I need to record an modified camera screen, i.e. detect some objects, mask them and save that masked video.All samples I was looking at only demonstrated how to record a video, live detect some features and display the detected features.i.e. use captureOutput(_, didOutput:from:) to modify the sample buffers and use that as AVCaptureInput for an AVCaptureSessionHas anybody an pointer where to look?Another Q: What happens when a AVComposition is saved? Is the original video stream recorded and an effect track or is the video stream "rendered down"?Thanks, Thomas
Posted
by Thomas E..
Last updated
.
Post not yet marked as solved
1 Replies
554 Views
Hi, I have an internal application that is currently deployed to our customer via TestFlight. Now the customer wants to use MDM (AirWatch) to distribute the app - re-signed with his enterprise account. Is there any good tutorial what to export from Xcode and how to re-sign an application?
Posted
by Thomas E..
Last updated
.
Post not yet marked as solved
0 Replies
512 Views
Hi,I'm trying to export an application for Adhoc deployment with Xcode 11.When I choose my manual genrated .mobileprovision profile, I get the error "Profile doesn't match the entitlements file's values for the application-identifier and keychain-access-groups entitlements."The "Archive build" is signed and generated with my "IOS Developer" key and identity (XXXXXX), the mobileprovision is for my employers identity (YYYYYY).What do I need to do so I can export the build as Adhoc build?codesign -d --entitlements :- App Adhoc Executable=App Adhoc <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>application-identifier</key> <string>XXXXXXX.com.company.resigned.APS</string> <key>com.apple.developer.team-identifier</key> <string>YYYYYYYYY</string> <key>get-task-allow</key> <true/> <key>keychain-access-groups</key> <array> <string>XXXXXXX.com.company.resigned.APS</string> </array> </dict> </plist>
Posted
by Thomas E..
Last updated
.