ios8 How to use containing app classes in today extension (widget) app - xcode

I have an application and I'm going to add a widget to it to show the containing app's summary data. Is there any way to use containing app's classes and methods in today extension app?
How should I get the widget's data from my main app?
thanks alot

You could use '''NSUserDefaults''' with app groups

Related

Xamarin-iOS: host application will not run with share extension

My app setup is a basic new app with default viewController with the default classes for share extension on iOS 11.2.
The host AppDelegate class FinishedLaunching never gets called.
Just shows the launch screen and closes the app.
The sample Xamarin app provided also has the same issue.
Link to the sample app:
Share Extension sample
Any idea whats going wrong?
Do you want to open the app which you created with the share extension, when user clicks the share button to use this share extension? If so, this app should be called Containing App.
But unfortunately, there's no way to do this on iOS8.3+ except Today Extension. From this post we know that:
The intended approach for share extensions is that they handle all of
the necessary work themselves.
Also from the Apple documentation about extension:
An extension’s UI should be simple, restrained, and focused on
facilitating a single task.
Apple doesn't recommend us to open its containing app from extensions, actually it avoids that. If you want to retrieve data in containing app, you can set up an app group so that data can be shared between these two apps.

How can Xamarin be used to wrap a web app as if it were a native app for Android?

Say I build a super mobile friendly web application that I want in the Play Store for Android users to be able to download.
Could I use Xamarin to:
Wrap the entire mobile app as a single WebView
Register for mobile push notifications
Essentially shortlining an MVP of an android app by using an existing web app? If so, is there any well-known process or documentation that demonstrates this?
Probably the best approach for you would be using Xamarin Forms with one or more pages containing only web views.
I don't love Xamarin Forms because usually for me Xamarin Android+iOS gives a better result in similar time, but your app would be so simple that doesn't make sense to do it with Xamarin Android.
Make sure that your web app will show only what makes sense to be shown in your app, otherwise you risk to see double header/footer, useless buttons... but if the website is yours adding a few parameters to change a bit the UI won't be a problem I guess.
Have a look at this example:
https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithWebview
Another approach is the use of Razor to build your pages in html directly inside your app, but if I understood well it's not what you need:
https://developer.xamarin.com/guides/cross-platform/advanced/razor_html_templates/
Although it is technically possible to do this as the previous answer has suggested. I would recommended firstly reviewing, the relevant stores guidelines on submissions. Apple for example will not allow a submission to their store of any application that simply mirrors the functionality of a website. I suspect Google's would likely be the same.
However that said, to answer your question, Xamarin.Forms would be appropriate for a simple application like the one you are suggesting. Or if you prefer to build to a specific OS, then in iOS with Xamarin you would use the Safari View Controller that was added in it's xcode 8.1 release. Android uses something similar as does windows.
EDIT:
You can use the Web View control in Xamarins Andorid native PCL project to encapsulate your mobile friendly website within an application here is the documentation:
Xamarin Android Developer link to Android Web View
As for push notifications, yes this is perfectly possible using Xamarin.Android. and varies on implementation depending on what you want to use as the back end to handle them, I.E. Azure's notification hub etc.

Is it possible to create an iOS 8 sharing extension that opens the website in its app?

I'm building an app, and I was curious if there's a way to open the app when you're on the website through the iOS Safari extension. So, if I'm on a post I'd tap the app icon in the share sheet and I'd pass that to the app to load the post in the app.
I know the Bing app can translate the current website and inject directly into the DOM, so I was wondering what custom logic you can implement.
There's really no way to open the app from this kind of extension. Extensions can't access [UIApplication sharedApplication], so they can't call openURL:. There's an openURL:completionHandler: method on NSExtensionContext, but it only works in "today" extensions. Share extensions can display a fully custom UI and can save data that's available to their containing app, but they can't actually open that app.

Can we create multiple today extension widgets for the same app in iOS8?

My question is quite simple, when developing a new iOS8 app, can we create two today extension widgets for the same app (each extension having a different functionality of app)?
I do not want to create a massive single today notification widget like how the Day One app have done it.
Yes, you just add two or more widget/tooday targets to your workspace

In a codrova/phonegap based Xcode project, how do i turn my single view app into a multiple view app?

I have set up Cordova/phonegap to work in Xcode and written a simple app in HTML and CSS and tested it on the Simulator and it works. It's just a single view app. I am trying to figure out how to turn that into a multiple view app, so that there are several views/screens that link to each other.
Do I need to write several HTML documents and link them together in XCode, or is it written in one HTML document using JavaScript?
With PhoneGap, think of it as operating a tiny web server on your device. So, you build it out like you would any other web site - with links to other pages that sit in that folder/directory or even on other servers - and it will allow that navigation. So, once you get it set up and deployed via Xcode, all you need to do is modify the html/css/js.

Resources