Post

Replies

Boosts

Views

Activity

CloudKit for near realtime exchange of small data?
I need to exchange small amounts of data in my app near realtime between users who could be anywhere with only an internet connection. One user becomes a team leader and needs to send data (just a few bytes) to all other users on their team - up to 50 - about each second. Then each team member needs to send data (again, just a few bytes) back to the leader about each second. The requirement is similar to the example app from last year's WWDC networking part 2 video called TicTacToe, except the users may not be local. Is CloudKit a good fit for this requirement? I'd like to use it due to its easy integration with iOS apps, no need to setup or maintain a server environment and the way it deals with security. But I'm unclear as to whether CloudKit performance can deliver small records at that speed. Does anyone have a voice of experience using CloudKit for small, quick data exchanges? If not, is there another iOS framework I should consider? I've looked at GameKit but asking users to initiate a session in gamekit is a requirement I'd rather avoid. Thanks in advance for any guidance.
9
0
3.0k
Apr ’20
Using GameKit for Leader to many Follower type connections
I need to exchange small amounts of data in my app near realtime between users who could be anywhere with only an internet connection. One user is a Leader and needs to send data (just a few bytes) to all Followers - up to 30 - about each second. Then each Follower needs to send data (again, just a few bytes) back to the Leader about each second. The requirement is similar to the example app from last year's WWDC networking part 2 video called TicTacToe, except the users may not be local.I've tried using Game Center but can't get it right. I've been able to achieve most of my objectives with this GameKit implementation:Follower starts:[[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0x0000000F; request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...Leader starts:[[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0xFFFFFFF0; request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...You can update UI with the completion handlers, but don't count on a real match until:- (void)match:(GKMatch *)match player:(GKPlayer *)player didChangeConnectionState:(GKPlayerConnectionState)state { use the match / player combo to note the connection for both leader and follower. Add to array of followers for leader. If Leader, call your Leader starts code again }Send data to either with:[match sendData:encoder.encodedData toPlayers:playerArray dataMode:GKMatchSendData(Un)reliableerror:&error];and receive in:- (void)match:(GKMatch *)match didReceiveData:(NSData *)data forRecipient:(GKPlayer *)recipient fromRemotePlayer:(GKPlayer *)player { // you've got mail from player! } So far, so good. Here's the bad news: depending on network strength, connections disconnect regularly. Even though I've built in dependable reconnect code, it can take up to 15 seconds to reconnect so it really isn't a good "real-time" experience.I'm currently testing with various combinations of data size (sometimes pad it so it's heft may keep the connection) or frequency (sometimes just send a "poke me" message) or tweaking the reliable vs unreliable flag in the send message calls.I can get about 10 followers per leader on a good day, but other times, more than 3 followers cycle between connect, disconnect, reconnect in an unusable fashion.I'm still trying to make usable, but wanted to document my success/failures so far in hopes that I can help many and perhaps get help from a few.Any ideas would be welcomed and any tweaks will be tested and reported.
9
0
1.6k
Jun ’20
ERROR ITMS-90334: Invalid Code Signature Identifier. 
I get this error when trying to submit a beta build. App Store Connect Operation Error  ERROR ITMS-90334: "Invalid Code Signature Identifier. The identifier "com.apple.WK" in your code signature for "app name watch" must match its Bundle Identifier "com.appname.watchkitapp"" I don't know of anything that has changed with the code signing since last successful submission, can't find "com.apple.WK" anywhere in my project and have tried submitting a previous version with no changes and get the same error. Anyone have any idea what I could be doing wrong?
14
0
4.5k
Oct ’20
[MPMediaLibrary defaultMediaLibrary] addItemWithProductID: freezing in iOS 14.0.1
I use addItemWithProductID: in the code below to add an Apple Music track to the user's library. This is mature code that's worked fine previously. But now in iOS 14.0.1 it causes the app to freeze. I can trace when running from Xcode or the released app version from App Store and the app freezes after the line: NSLog(@"just before addItemWithProductID %@", productID); The ">>>added..." line is never called. Any idea as to how to remedy? (void) addAppleMusicTrackWithProductID: (NSString *) productID {         NSLog(@" addApplemUsic has been called for productID: %@", productID);         SKCloudServiceController *cloudServiceController;         cloudServiceController = [[SKCloudServiceController alloc] init];         [cloudServiceController requestCapabilitiesWithCompletionHandler:^(SKCloudServiceCapability capabilities, NSError * _Nullable error){             NSLog(@"capabilities: %lu error:%@", (unsigned long)capabilities, error);             if (capabilities >= SKCloudServiceCapabilityAddToCloudMusicLibrary)             {                 NSLog(@"just before addItemWithProductID %@", productID);                 [[MPMediaLibrary defaultMediaLibrary] addItemWithProductID:productID completionHandler:^(NSArray<__kindof MPMediaEntity *> * _Nonnull entities, NSError * _Nullable error) {                     NSLog(@">>>added %@ with %i entities: %@ and  error %@",productID, (int) entities.count, entities, error);                     NSArray *tracksToPlay = [NSArray arrayWithObject:productID];                     [musicPlayer setQueueWithStoreIDs:tracksToPlay];                     [musicPlayer play];                     NSLog(@">>>>now playing AM title:%@ | artist:%@", musicPlayer.nowPlayingItem.title, musicPlayer.nowPlayingItem.artist);                                      }];             }         }]; }
8
0
2.7k
Oct ’20
Bulk Subscription that allows sharing features to other users
My iOS app targets fitness instructors and coaches and currently offers a free app with basic features and two in-app monthly subscriptions for two additional sets of features, which are marketed to the individual instructors/coaches. I've encouraged facilities to reimburse their instructors for individual subscriptions, but the facility deciders want something simple and a steady monthly rate. I'd like to add a subscription for facilities at a higher price point that would allow the facility to 'authorize' the features of the individual subscriptions to multiple instructors/coaches that are part of the facilty. For example, a facility subscription of $49/month could authorize up to 10 users to have the same feature set as the $10/month individual subscription. Does the app store have any models that work for this scenario? I don't think it fits the enterprise program, as there are many facilties but I'd like each faciltiy to be able to pay for the feature for individuals that work there. Asking for details I've missed or offering advice would be appreciated.
0
0
980
Jun ’21
Music app skips second track of a playlist in iOS16 & 16.1
I've had several users report weird track progression in my app. There was no code changed in my app, but around the time of iOS16 or iOS16.1 users started reporting unexpected results from track progression when my app loads a playlist to MPMusicPlayer and lets the music player have control of track progression. A little more sleuthing has led me to see that often (though not always) when a playlist is loaded by creating an MPMediaItemCollection with saved mediaItems and using setQueueWithItemCollection to load to the music player, the first track plays as exected, but when the track end is reached and the music player should progress to the second track, instead it progresses to the third track. No stutter, no error and the logic of my app just follows the playing track, so my users have a bad experience. Is anyone else having this problem? If so, any ideas how to solve?
1
0
859
Nov ’22