How can I open default Calendar app with in my application? Currently I am accessing it using the following link but I am unable to back to my app.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"calshow://"]];
You can find on this site useful layout in order to replicate default Calendar app appearance inside your application. There's also this project, in the end you can find a SimpleEKDemo on Event Kit reference on developer.apple.com that uses native components.
Related
I am adding a Widget Extension (named Complication) to my WatchOS app. When creating the widget, I am not able to select an application in the field "Embed in Application". The app name shows up, but I can only select "None".
When I want to preview the widget, the following error message comes up:
AppExtensionNeedsContainingAppError:
ComplicationExtension.appex must be in an app
The app extension "ComplicationExtension.appex" needs to be embedded
in an app in order to use previews
What can I do to get it to work? I added the app in the Target Membership but that does not work. What am I missing?
I am trying to add Admob Ads to Xamarin.IOS but i am unable to figure out way to achieve this goal.I have already searched internet but couldnt find the solution
Google Admob is available in Xamarin.iOS .
1.install the package Xamarin.Firebase.iOS.AdMob from nuget.
2.Registring with AdMob
So, the first thing that you will need to do is actually register for AdMob. This is the same thing that I did in Android, but I created an iOS project. This will give you two important pieces of information, your “Application Code” and your “Ad Unit Id”. We will use these later, but simply go to: https://apps.admob.com, register for a new app, link to an app in Firebase, and you will be off running.
3.Add GoogleService-Info.plist
When you create the new app in Admob/Firebase there will be a Google Service config plist file that gets downloaded. Add this to the root of your iOS project and make sure that the Build Action is set to BundleResource. This is super important!
4.Update AppDelegate
MobileAds.Configure("Your Publishing App Id");
You can ask for more details about Admob . And here is a sample that you can refer.
How to identify whether some particular application is already installed in my device or not through xamarin forms? (I want to achieve in android and ios).
Explanation :
In native windows application I have used one service which give me following data (App Name, App Icon Image, App Id, Publisher Id, Version name).
I have checked whether particular application is already installed in my device or not through App Name, App Id, Publisher Id.
Suppose app is installed then I checked version of the application if its fully updated then "Launch" button display and if it is not then "Update" button display.
If application is not installed then "Install" button display and this button redirect me directly through play store.
Same thing I want achieve in android and ios through xamarin forms.
which things are required through service for android and ios?
How to redirect directly to play store in android and ios?
Method 1:
Try using App Links. You need to install the Rivets component from the Component Store. You can handle the navigation to play store if not installed and else browser based on your URL.
Rivets.AppLinks.Navigator.Navigate("http://any.old.url");
Your app will now attempt to Navigate to another installed app for the URL using App Links, or will fall back to usingUIApplication.OpenUrl in ios/or will fall back to using an intent with a view action in Android, if no App Link meta data is found, or no apps for the metadata are installed.
Method 2:
For example I have handled the situation for facebook app to open a page from my xamarin app but not by using App Links.
Device.OpenUri(new Uri("fb://page/page_id")); // Launch the page in facebook app (if facebook app is installed) from my application.
The above code line when executed, will open the specified facbook page in facebook app. Notice "fb://page/page_id" this is the intent with specific uri provided from facebook. You can read more about it here.
Use Plugin.Share to use CrossShare to open a browser cross-platform from your xamarin app. This I have used below.
The above code will throw an exception if facebook app is not installed, then you probably need to redirect to the play store of Android or the app store of Apple.
For Android:
CrossShare.Current.OpenBrowser("https://play.google.com/store/apps/details?id=com.facebook.katana");
Here com.facebook.katana is the package name of facebook app in android. You can replace with your application's package name if registered on playstore. This will automatically launch in playstore not in browser.
In case of IOS redirect to App store:
CrossShare.Current.OpenBrowser("https://itunes.apple.com/us/app/facebook/id284882215/");
Here id284882215 is the app id of facebook on Apple's app store.
I'm writing an application with a WatchKit extension.
I used to be able to register for notifications outside UIApplicationDelegate using [[UIApplication sharedApplication] registerForNotificationTypes:].
[UIApplication sharedApplication] is now unavailable in projects containing a WatchKit extension.
How would I go about registering for notifications outside UIApplicationDelegate now?
For clarity: I am trying to register for notifications in my containing app, not the watchkit extension.
A WatchKit extension is not allowed to send notifications.
Please use the containing app to do this feature and then, in the WatchKit extension you'll be able to show and customize the appearance of the notification.
Like for any iOS extension*, the code (source file) which is part of WatchKit extension target cannot access a sharedApplication object, and so you cannot use any of the methods on that object. For code (source file) which is part of your App's main target (and not of WatchKit extension target), you can still use the below call
[[UIApplication sharedApplication] registerForNotificationTypes:]
So probably you are using this call from some source file which is added in your WatchKit Extension target.
*App Extension Programming Guide
As of WatchKit 2, circumstances have substantially changed. You can now access a shared delegate object in the WatchKit App Extension, and by accessing the WKExtensionDelegate you have access to six notification-related methods:
didReceiveRemoteNotification(_:)
didReceiveLocalNotification(_:)
handleActionWithIdentifier(_:forRemoteNotification:)
handleActionWithIdentifier(_:forRemoteNotification:withResponseInfo:)
handleActionWithIdentifier(_:forLocalNotification:), and
handleActionWithIdentifier(_:forLocalNotification:withResponseInfo:)
See the Apple Documentation for more information.
I want to add a rate-button to my application. How can I do this?
- (IBAction)rateGame {
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:#"itms-apps://itunes.apple.com/app/idYOUR_APP_ID"]];
}
In the simulator, this doesn't work. (Can't test it on a real device right now)
Is this the correct way to do this or should I try something else?
Your code is correct for launching the App Store with the app page open; I use the same code in my shipping app. This is the best you can achieve on iOS 7. It doesn't work on the iOS Simulator because the simulator doesn't have the App Store or iTunes apps installed, so there's nothing to launch.
Try using iRate. Handle all network connection and other related issues. And easy to implement. Just drag and drop files to your AppDelegate. It automatically configures all the required terms(like app store id, etc) from the info.plist files, and gets all the required information from app store.
NOTE: iRate can be used without any configuration, just by dragging and adding the files to project. See this example.
#import "iRate.h"
#implementation AppDelegate
+ (void)initialize
{
//configure iRate
[iRate sharedInstance].previewMode = YES;// yes for testing
}