What's the link to the ratings page on iTunes for my app?
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"???"]];
This other question has an appropriate answer. Note that the type=Purple+Software part is literal and not the name of your company. The only thing you need to change is the app id. This example is a little strange in that the string is broken up into several strings, I would just use one for the format to substitute the app id.
The end result looks like this:
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=123456789
after iOS7 #Jon Steinmetz link deprecated. so, you should write a code divide os version as follows.
if([[UIDevice currentDevice] systemVersion].floatValue >= 7.0f)
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"http://itunes.apple.com/app/id%#", #YourAppID#]]];
else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%#&pageNumber=0&sortOrdering=1&type=Purple+Software&mt=8", #YourAppID#]]];
Creating a rating link could become a complex issue when supporting multiple OS and multiple platform. For example the WebObjects isn't supported on iOS 7 (some of them), some links you create would open another country store then the user's etc.
There are 2 related open source libraries that could help you:
iLink - There the link would be found at run time (the library would check the app ID and the OS it is running on and would figure out what link should be created). The best point in this is that you don't need to configure nothing before using it so that is error free and would work always. That's great also if you have few targets on same project so you don't have to remember which app ID or link to use. This library also would prompt the user to upgrade the app if there is a new version on the store (this is built in and you turn this off by a simple flag).
Copy the 2 library files to your project.
On your appDelegate.m:
#import "iLink.h"
+ (void)initialize
{
//configure iLink
[iLink sharedInstance].globalPromptForUpdate = YES; // If you want iLink to prompt user to update when the app is old.
}
and on the place you want to open the rating page for example just use:
[[iLink sharedInstance] openRatingsPageInAppStore];
and import iLink.h on the same file.
There is a very good doc for the whole library there and an example projects for iPhone and for Mac.
iRate - This library is super recommended if you want the library to prompt the user rating process automatically. Just set the parameters you want and it would do the work for you (also have translations for lots of languages). The downside is that you would use an alert view for that and not your own UI.
Related
Can I invoke another installed applications within my application? Suppose I have installed AngryBirds, I have to invoke that application by tapping a button from my application. Is it possible?
You can do it if the application in question has a defined protocol, in example if you want to call a number via skype you can perform an action like
NSString *contactName = #"user123";
NSURL *skypeURL = [NSURL URLWithString:[NSString stringWithFormat:#"skype://%#?call", contactName]];
if ([[UIApplication sharedApplication] canOpenURL:skypeURL]) {
[[UIApplication sharedApplication] openURL:skypeURL];
} else {
// Display to the user how to install skype.
}
the same can happen for other programs which have a protocol definition that could be understood.
And just 4 the record, here's a list of know URL Schemes
http://wiki.akosma.com/IPhone_URL_Schemes
Then, if you want your app to be URL-Scheme Compatible, you can have a good start by reading this:
http://www.idev101.com/code/Objective-C/custom_url_schemes.html
and this other post is really good and detailed.
How do you set your Cocoa application as the default web browser?
it explains how to make your app handle a custom URLScheme, which turns out to be your case.
hope it could be helpful.
k
for other case scenarios I got no idea if it is possible.
No, it's not possible to do that, unless the apps in question support URL Scheme, then you can launch it using URL.
Not possible, because all iphone apps will run in a different individual process with their own runtime environment. There is only a limited IPC(Inter process communication) available, that too for system libs and resources.
No. There is no way to open an another app within app. However you can open an different app from your app vise versa by using
URL Scheema
Open_In functionality using CFBundleDocumentTypes and UIDocumentInteractionController.
How do I put a Twitter button in my iOS app so the user can tweet their score?
Take a look at ShareKit: http://www.getsharekit.com/
It's pretty self explanatory, with documentation on the website
And it offers more than twitter, if you want it.
Just saw this question and thought I'd point out that with the upcoming iOS 5, there will be native Twitter support for every app. No technical/implementation details yet, obviously, but if you care to wait for a while you can get your hands on a native library, which will probably make your life a lot easier!
http://www.appleinsider.com/articles/11/06/09/inside_apples_ios_5_built_in_twitter_integration_makes_tweeting_a_snap.html (one source of many)
For anyone still interested, just read an awesome post on exactly this issue. See link for a step by step guide. He couldn't have made it any any easier :)
http://buildinternet.com/2011/10/tweet-sheet-creating-a-popup-tweet-in-ios-5/
Another option: DETweetComposeViewController
Works with iOS 4 and later.
Just check this blog post out for Twitter integration in iOS 5.
The advantage of using the tweet sheet is that it’s built right onto iOS, this means lots of things:
Standard interface throughout the OS
Automatic use of the user’s system Twitter account
Automatic check for a tweet less than 140 characters long
Easy image and link attachments
Easy to program, no need to implement OAuth or connect to the Twitter backend
As you can see we have lots of advantages and incentives to use this and, being that it’s so simple, there’s no excuse not to include Twitter functionality in your applications!
Just include the header file #import "Twitter/Twitter.h"
and add the framework Twitter.framework in the project..
and add the below lines for a button action
TWTweetComposeViewController *tweeter = [[TWTweetComposeViewController alloc] init];
[tweeter setInitialText:#"your score"];
[self presentModalViewController:tweeter animated:YES];
That all.. ur score will be posted...
If u want to add picture use [tweeter addImage:image ];
If u want to add url use [tweeter addUrl:#" your url"];
You can add an EasyTweet button to the app and where it says "Hello. This is a tweet." just add in the relevant content, ie "Just scored 42 points on YourApp.". This will be found in the ViewController.m file.
I found a page (http://itunes.apple.com/linkmaker) to get the iTunes url for a specific page which I assume should direct the user out of my app and into the corresponding page in the app store.
I have never done this or any other UIWebView stuff but after some searching I found some code that I thought would work that uses UIApplication.h.
My code is:
#import <UIApplication.h>
//...in a tableView....
case 8:
- (BOOL)openURL:(NSURL *) http://itunes.apple.com/us/app/lockbox-pro/id288460603?mt=8&uo=4;
break;
openURL has an error saying that it is undeclared - but I imported the UIApplication.h file. Then I saw that the UIApplication import also had an error on it. I don't think that I want to use UIWebView because from what I understand, that opens up the URL in the app itself - I want to direct the user to the App Store. Where am I going wrong?
EDIT: Okay, I changed it to a simple button that is supposed to close the app and bring the user to the itunes page:
- (IBAction) pressedFull {
[[UIApplication sharedApplication] openURL:[NSURL urlWithString:#"http://www.google.com"]];
}
I linked it in IB - it still crashes the app when the user clicks on it.
Your code has a number of things wrong in just one line. First, you're typing the method signature rather than using the method properly (ie, sending a message to an object). Second, you're not enclosing the string.
Try this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://yoururlhere"]];
With respect, you should review the Learning Objective-C: a Primer thoroughly until you are more comfortable with the syntax as well. A quick look at some of your other questions suggests this is your biggest issue. You'll be doing yourself a huge favor by setting all else aside and concentrating on getting Objective-C well and truly under your belt before continuing.
i want to make an application which makes phone calls.i am new in this field.Please give some guide lines.
The URL scheme format (according to the Apple URL Scheme Reference) is tel: NOT tel://. While the latter works now, it is not consistent with Apple's documentation and may not work in the future. Aside from that detail, Noah's and mihirpmehta's suggestions are the correct way to initiate a phone call from within your app. Keep in mind though, that your app will quit when the phone app is launched so you may want to save state before opening the URL.
use
[[UIApplication application] openURL:[NSURL URLWithString:#"tel://8005551212"]];
It will only work in iphone... not in simulator...
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://5558675309"]]
I am referring to the popup window that asks the user to submit a review/rating.
I know it can be done since the Aardark app does it...it asks several times in fact! (Almost too spammy.) But there has to be an API to trigger the rating request? Google is giving me no love on this one.
I would check out the Appirater project that Arash Payan has put together.
Pretty much handles the checking and displaying of the "rate my app" prompt, and brings the user right into the review portion of your app on the App Store.
It's a very clean, and elegant way to provide that minimum barrier so that your users are more likely to submit reviews of your app.
Hope this helps...
I have written about a way to open right into the review panel of the App Store.
http://www.memention.com/blog/2009/09/03/Open-Reviews.html
The actual code part if called through a button press could look like below
- (IBAction)gotoReviews:(id)sender
{
NSString *str = #"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:#"%#/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:#"%#type=Purple+Software&id=", str];
// Here is the app id from itunesconnect
str = [NSString stringWithFormat:#"%#289382458", str];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
I wrote a library to do this - similar to Appirater but a bit more configurable and with Mac App Store support:
https://github.com/nicklockwood/iRate
I have discovered the most subtle value of S.O. (already obvious to all elementary school teachers) --- often by simply forming your question, your neurons rearrange and you are more successful at answering it yourself! (Either that or Google optimized my search after spying on my keystrokes and indexing my question on S.O.)
Answer found after more productive googling:
http://www.mobileorchard.com/fighting-back-against-the-app-stores-negative-rating-bias/
this may not be what youre looking for EXACTLY but what i would do is just prompt them in the app somehow and somewhere not too annoying with a button or alert view and have that button link them to app url in safari which opens the appstore to your app. you can use the url http://www.itunes/apps/ (your app) as i believe is the synthax. i cant remember the exact code but i can get it for you if need it.
We AskingPoint have another way to do it (Im a founder) that provides BOTH App Analytics and the rating widget. You can adjust server side settings based on your analytics to prompt only your best users. Change settings on the fly. And it's translated into over 30 languages.
I wanted to do this when I roll the app out for the first time... looks like I'll have to wait and put it out as an update to ensure that it will work... let me know if I am wrong and there is some way I can test this before submitting to apple for distribution.