Fetch or Push values from Parent application to Intents extension in iOS? - ios

I am creating a SiriKit extension for my application for a payment.
I want to fetch some data from parent application & use that data to populate.
How to fetch data from Parent application ?

To share data between app and app extension, you should use App Groups.
Please refer following links:
http://www.atomicbird.com/blog/sharing-with-app-extensions
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html

Related

iOS - How to pass string from main app to widget without using app group

As title, have any idea let widget get main app data?
As I know using App group to save & load the same suite userdefault.
Does have another way to achieve this feature?
Thanks.
AFAIK as you just mentioned the App groups is the way to go when sharing content between your main App and your widget.
Apple is really restrict about user data safety, and don't think there is there any other way to share content without using the app group as we can see on their documentation available here (Sharing Data with Your Containing App)
Something that would try is using a local notification I think this might work to trigger a local notification to your extension and handle the string on the other side :)
More details available here

How can I pass data from app extension to host application and upload it Firebase?

I am using an app extension to allow users to save webpage URLs to my app so I can display them in a UITableView. I have created the action extension but I'm especially struggling with uploading the data to Firebase. I know it is not performance-friendly to upload to Firebase from the Action Extension, so I want to send the URL back to the host app to be processed. The one question I have though -- how can I notify the host app that a new URL has been retrieved using the action extension so I can upload it to Firebase?
I was planning on using delegates and protocols, but there is no way to use them in app groups. I also have looked into MMWormhole, but I am not sure how that would work with my app's needs.
How can I notify the host app that a URL has been retrieved using the action extension so I can upload it to Firebase?

How to fetch the phone number for the imessage extension created application

I am trying to implement an iMessage Extension application, i want to fetch the number for whom i have selected the imessage to be created with the app i have created.
How to fetch the number whom I am sending this custom message. Any idea ? as I could not get much information from the Message Class referenced in the 'MSMessage' library file.
I can only access the UUID which is not what I want.
Thanks for any suggestions given.
For the moment it's not possible. It's more a question of privacy, Apple doesn't want dev to access private data like that. Maybe later Apple will allow it via a permission asked to the user (like they do for agenda/position etc).

How to show latest data on your app from a web server

I have a parse.com backend and a swift ios8 app.
What is the best way for the apps that use the backend to be notified of changes to a certain table so that a collection view can reload its data?
Data is added to the db from one of the apps not via the website.
Would I need to setup push notifications? Or would I do regular checks from the app To see if data has changed? Or is there another way?
Use push notifications is the better way to achieve your goal.
Here's the steps:
1.Data added from another app to the db in your backend
2.Your backend shoud post a push notification to all your app
3.when your app received the notification, it must pull the newest data from backend and refresh the view in app
Regular checking from app will has a bad influence on you app's performance, so do not use this way if possible.

share core data between many users on app

I wanna develop an iOS app as the platform for many users. Is it possible to enable multiple users of my app to share resources on the same core data database?
The other alternative to iCloud (with the whole ownership issue) is to have an online server that stores the data remotely.
Then you can create a web service to store and retrieve the data from the server onto the device.
yes This can be done using a custom url scheme on the iphone by help of iCloud URL.
but it has some dark sides.If you use a custom url scheme, only one application "owns" the data. The other application would have to import data from the main application.
another method is system pasteboard i.e. clipboard. you can put stuff on it and then launch another application with a URL that tells the other app to check the pasteboard.There's also the system pasteboard .
for more information on custom URL scheme check this link

Resources