iPhone: Button "Vote in AppStore" - objective-c

I would like to add a button "Vote Us" that opens App Store and brings automatically users to my app review page where they can vote my app.
How can I do it?

I think the easiest way to access specific pages on the App Store is to use the URLs, which are opened automatically on the iPhone using the Store app. For example, sending the user to http://itunes.apple.com/gb/app/polytune/id364009203?mt=8 takes them to the PolyTune page in the App Store. I'm not sure if there is a more direct way to achieve it.

Use this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
#"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID&mt=8"
]];

Related

Bring other running app's window to front

What I am trying to achieve: when user presses "buy" in my app, App Store window should appear with my app url in it.
This works fine when App Store is not running: [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:#"macappstore://..."]];
But when App Store is already running and is minimised in the dock it's window doesn't show up. It becomes active, yes, but the window doesn't appear.
What I have already tried: fetched app using NSRunningApplication and trying to unhide, activateWithOptions: it, but this doesn't work.
I don't see more options in NSWorkspace and NSRunningApplication, so if someone have some solutions for this, it would be appreciated.
Mmm I can't think of any approach that does not involve Applescript or Accessibility APIs which then requires the user give your app access permission which is even worse. (I mean, you could quit and relaunch App Store, but that's jarring.) Honestly this is bad behavior in App Store, so you should file a report with Apple noting the window doesn't come to the front. It won't help you now, though.
But doesn't this bring it to the front even if it's minimized?
NSWorkspace.shared.launchApplication("App Store")

Link to developer's apps

How do I open the App Store on the Apple TV to show all the apps created by a specific developer?
The iOS way, http://appstore.com/DEVNAME, does not work on Apple TV.
I use this method:
NSString* url = #"some url";
[[UIApplication sharedApplication] openURL:[NSURL url]];
To get the details of a developer,
https://itunes.apple.com/lookup?id=1074241891
To get all apps by that developer,
https://itunes.apple.com/lookup?id=1074241891&entity=software
To get the apps based on localization,
https://itunes.apple.com/lookup?id=1074241891&entity=software&country=gb
or
https://itunes.apple.com/gb/lookup?id=514675684&entity=software
I don't know why it is currently making me download a js file, it is suppose to display JSON response in browser? Maybe just temporary?

Share on Instagram/WhatsApp without UIDocumentInteractionController

Is there any way to share an UIImage to Instagram and WhatsApp without using UIDocumentInteractionController?
I want to set a button for IG that won't open the OpenIn menu, and won't make me select an app from the menu.
Same goes for Whatsapp...
Or perhaps a way to use UIDocumentInteractionController but somehow setting the selected app to be (for example) Instagram without prompting the user to choose IG app from the OpenIn menu.
Thanks in advance
Haim
No, there is no way to share an image without UIDocumentInteractionController. Perhaps Whatsapp or Instagram will provide an API for this in the future.

Open Mobile Safari without using openURL:url

I want to open the Mobile Safari app "WITHOUT" changing its currently displayed page.
I can easily switch to Safari using ..
NSString *ourPath = #"http://www.google.co.uk";
NSURL *ourURL = [NSURL URLWithString:ourPath];
if ([ourApplication canOpenURL:ourURL]) {
[ourApplication openURL:ourURL];
}
But what I want to do is just switch to safari and not navigate away from the page it is currently on. Like when I switch using the task switcher, it just pops Safari and leaves it on the page it was.
I've tried sending it a url of #"http:" but this doesn't work it changes pages to to "http:localhost/"
Is there a way to just Open it?
Plasma
I solved this using the answers on this page ..
iOS How can I use UIApplication launchApplicationWithIdentifier which is in private APIs?
Though I didn't have to move my .app file in to /Applications
It was enough to add the entitlements, then simply call it using ...
[[UIApplication sharedApplication] launchApplicationWithIdentifier:#"com.apple.mobilesafari" suspended:NO];
Plasma
Could you open to a page that executes JavaScript history.back() when loaded?

How to programmatically add calendar subscriptions on iOS?

Via the settings panel of your iPhone, you can add a subscription to a remote .ics calendar format. I have a Dutch iPhone app that does this from within the app (see the screenshot below, "abonneren op de agenda" means "subscribe to the calendar"), but there must be others too.
I want to mimic this behavior for a project of mine, but I can't find the API to do this with. It looks like it's not a part of EventKit, but because there's no app switching going on when you hit 'subscribe' in the example app I suspect it's also not a url scheme.
Who knows?
Try something like this:
NSString *url = #"http://server/filename.ics";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
This shows an uialertview with the question to the user if he/she wants to subscribe.
;)