Posts

Post not yet marked as solved
0 Replies
789 Views
Hi, I am developing a Final Cut Pro workflow extension. I would like to upload a Final Cut Pro video with the extension. As far as I understand both the macOS app and the extension are sandboxed and the user doesn't have a direct access to the Final Cut Pro folders. Here there is a described way to receive media through a custom share destination. So far I have been able to parse the XML describing the video after dragging the video from FCP and dropping it in the extension. I have the URL of the video but no access to it - permissions denied. Can I programmatically acquire access to the folder/ file in question? Or have the user allow access at the beginning and use it later? Or should I use custom shared destination for that purpose? Thank you in advance!
Posted
by roron.
Last updated
.
Post not yet marked as solved
0 Replies
286 Views
I am using an NSOperationQueue for an upload task. self.operationQueue = [[NSOperationQueue alloc] init]; self.operationQueue.maxConcurrentOperationCount = 5; There are two types of tasks - UploadChunkTask and FinalTask (NSOperation subclasses). I'd like the FinalTask to start after all the UploadChunkTasks are finished. So I add the tasks for chunk uploads as dependencies to the final task: FinalTask *finalOperation = [[FinalTask alloc] init]; for (int i = 0; i < self.file.numberOfChunks; i++) { &#9;&#9;UploadChunkTask *uploadOperation = [[UploadChunkTask alloc] initWithFile:self.file andChunkNumber:i+1]; &#9;&#9;[uploadOperations addObject:uploadOperation]; &#9;&#9;[finalOperation addDependency:uploadOperation]; } [uploadOperations addObject:finalOperation]; And finally I add the tasks to an NSOperationQueue: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ &#9;&#9; &#9;&#9;[self.operationQueue addOperations:uploadOperations waitUntilFinished:YES]; &#9;&#9; &#9;&#9;dispatch_async(dispatch_get_main_queue(), ^{ &#9;&#9;&#9;&#9;completion(); &#9;&#9;}); }); The problem is that the final task does not respect the dependency and gets executed with the other tasks (instead of waiting for them to finish first). This happens even if there is just one upload task. The final task is sometimes executed before the upload task. I noticed this issue disappears if maxConcurrentOperationCount is set to 1, but I need it to be set to 5. Thank you in advance.
Posted
by roron.
Last updated
.
Post not yet marked as solved
0 Replies
470 Views
The users of the software of the company I work in can download videos from there, then use Final Cut Pro X to process them, and then upload them. It would be great if importing and exporting videos from and to the projects can be done directly from Final Cut Pro X. From what I understand to achieve that we should use workflow extensions. Is that correct? I know that there is also the possibility to make plugins for Final Cut Pro X with FxPlug but these plugins seem to be for creating effects, and don’t seem applicable in this case, but please correct me if I’m wrong.As far as I understand workflow extensions are extensions to macOS apps. Does someone have more information on how they are developed? For example in Xcode there is no Final Cut Pro X extension option. I requested more information from Apple like a month ago, but am still waiting for response. I cannot post any code of what I tried, because I wouldn’t know where to begin.BTW I know about the drag and drop options between FCP and another macOS app and also the usage of Apple events and custom share destination, bu the idea is though not to leave Final Cut Pro for this.Any help would be appreciated.
Posted
by roron.
Last updated
.
Post marked as solved
5 Replies
1.4k Views
I have a consumable IAP in an app. The app has users and login/ logout functionality to switch between them. The amount of the consumable product associated with an user is stored on a server. So when the purchase is made a call to the server is made to "inform" it to update with the new amount of product. This call could potentially fail. From what I read what I should do there is to retry in background until it succeeds. I wonder how to handle the following cases:1. The user logs out and kills the app. Then on start of the app SKPaymentTransactionObserver is called with SKPaymentTransactionStatePurchased because the transactions has not been finished. How do I know for which user of the app this transaction is. Should I store transaction ID-s alongside some user specific information to continue retrying to update with the tokens for this user. Or is there a better approach?2. The state of the transaction is SKPaymentTransactionStateDeferred. Similar scenario as in point 1. The user logs out and either doesn't log in or logs in with different user. SKPaymentTransactionStatePurchased is received at some point and the app should update the correct user with the purchased product. The app could also be restarted in the process. Should again the transaction id be saved alongside some user information to make the update to the backend? Or is there a better approach.3. The user logs out. The user logs in the app on another device. SKPaymentTransactionStatePurchased probably won't be called and the user will receive nothing. Maybe I should just block the UI until the purchase is updated on the server also but I worry of some big delays. Also if the user kills the app in the waiting they will be charged but won't receive anything. So can I do something?Probably there are cases I am missing here, but these are the ones that come to my mind. I don't see similar questions very often and some specific handling is not mentioned so I wonder if things are not easier than I make them to be. The transaction observer is added in didFinishLaunchingWithOptions in AppDelegate and removed in applicationWillTerminate in AppDelegate.
Posted
by roron.
Last updated
.
Post marked as solved
5 Replies
5.8k Views
I have a UILabel and its attirbutedText value is set to something like "8 km/h" and is changing succesfully to other similar values. Later I want to set the attributedText with value of "-". I am dispatching the update on the main queue. The code for the update is called but it never updates on the screen and the previous assigned value stays. controller.speedValueLabel.attributedText = NSAttributedString(string: "-")One way to call this code is when tapping a button. When this happens the label updates with "-". Another way is in the block of a timer. The timer is started and stopped on the main thread. When it fires it does nothing and the UILabel is just not updated. I tried with similar timer (but another one) and it also updated succesfully. What can be wrong?
Posted
by roron.
Last updated
.