i want to share text data between two iphone apps. How can i use paste board for this purpose. Can anyone help me with a sample code. Thanks in advance. Suggest me if there are better ways than pasteboard to accomplish my task.
iCloud/third-party syncing If an app or game does feature iCloud syncing, you'll usually find the option in the Settings menu. Find it, toggle it on and make sure you're signed in to the same iCloud account on your other iPhone and the data should be synced between the two devices.
If you want to share data between applications, make sure you sign with the same key: Code/data sharing through permissions – The Android system provides signature-based permissions enforcement, so that an application can expose functionality to another application that is signed with a specified certificate.
The ability to share the same data resource with multiple applications or users. It implies that the data are stored in one or more servers in the network and that there is some software locking mechanism that prevents the same set of data from being changed by two people at the same time.
If you simply want to use IPC, make both of your apps recognize some URL scheme. Then call
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:@"theOtherApp://dataToShare"]];
to send, and use -application:handleOpenURL:
to receive.
To share strings via the pasteboard, use
UIPasteboard* board = [UIPasteboard generalPasteboard];
board.string = @"Some string to share";
to save, and use board.string
as a getter to retrieve the string to share. But if the user copy anything in between your shared data will be lost.
Alternatively, you can share stuff via:
/var/mobile/Library/AddressBook
and Keyboard
and Preferences
can be accessed even if your app is sandboxed. This may violate SDK rules though.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With