Google maps sdk callout issue ios6 - ios6

i am using googlemap sdk for ios 6 in my project
The problem i am facing is with Marker options
GMSMarkerOptions *londonOptions = [[GMSMarkerOptions alloc] init];
londonOptions.position = CLLocationCoordinate2DMake(51.500,-0.127);
londonOptions.title = nil;
londonOptions.snippet = nil;
[mapView_ addMarkerWithOptions:londonOptions];
Google states that if i set the title and snippet to nil then the marker would not show a callout if i tap on it.
but it does show an callout on tapping on it.
Has anyone faced this problem
Thanks in advance
Regards
Nitesh

I worked around it by returning an empty uiview :) but as share said, it is fixed now

Related

Creating AdMob Component Dynamically

I am having a trouble about Smartface App Studio about creating AdMob component dynamically. How can i do this in Smartface? In former edition, we could use AdMob component in toolbar. It was easy just drag&drop.
So in the new version, i need an example for both (Android and iOS, btw is any difference for both?) about my problem.
Thanks in advance.
Regards.
AdMob component should be added dynamically in your application.
You can create it like;
var admob = new SMF.UI.AdMob();
admob.adSize = SMF.UI.AdMob.AdSize.banner;
admob.adUnitId.Android = "AD_UNIT_ID_Android";
admob.adUnitId.iOS= "AD_UNIT_ID_iOS";
Pages.Page1.add(admob);
var adRequest = new SMF.UI.AdMob.AdRequest();
adRequest.addTestDevice(SMF.UI.AdMob.AdRequest.deviceIDEmulator);
adRequest.addTestDevice("DEVICE_ID");
adRequest.gender = SMF.UI.AdMob.AdRequest.genderFemale;
adRequest.birthday = new Date(2004,10,10);
adRequest.location = {latitude:41, longitude:29};
//You should load it for all pages.
admob.load(adRequest);
For more info please check the link : http://docs.smartface.io/?topic=html/M_SMF_UI_AdMob__ctor.htm
Smartface.io Team

Video sharing with thumbnail and play button, using UIActivityViewController in ios7?

Want to share video using UIActivityViewController with its thumbnail and playbutton icon.
I used .mp4 url but facebook shows url not thumbnail.
how to make possible to show video(thumbnail with play button) on Facebook without using following code, because it doesnt work.
ALAsset * asset = [[ALAsset alloc] init];
[asset setVideoAtPath:urlToVideoFile completionBlock:NULL];
NSArray * activityItems = #[asset];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:NULL]
The code which you have put is adding asset into array, don't put asset directly instead put url and try.

FBPlacePickerViewController doesn't load any data

I am trying to use FBPlacePickerViewController and it doesn't seem to load any data.
Here is my code:
FBPlacePickerViewController *picker = (FBPlacePickerViewController*)segue.destinationViewController;
picker.navigationController.navigationBarHidden = YES;
picker.delegate = self;
picker.radiusInMeters = 1000;
picker.resultsLimit = 30;
if([TonerAppDelegate instance].lastLocation != nil){
picker.locationCoordinate = [TonerAppDelegate instance].lastLocation.coordinate;
[picker loadData];
}
[TonerAppDelegate instance].lastLocationUpdateFunction = ^{
picker.locationCoordinate = [TonerAppDelegate instance].lastLocation.coordinate;
[picker loadData];
};
It is an embed segue (iOS 6). I verify that the picker is a valid object. The [picker loadData] method does get called, and the coordinate data is perfectly valid. I am not getting any exceptions or warnings. I've allowed my app to access to my location in iOS and I double-verified that in Settings. My iPod is connected to the Internet and the connection works perfectly. All the other apps can use location services without any problem. So, there probably is a problem with my implementation of the place picker. I've also implemented the -(void)placePickerViewControllerDataDidChange:(FBPlacePickerViewController *)placePicker and -(BOOL)placePickerViewController:(FBPlacePickerViewController *)placePicker shouldIncludePlace:(id<FBGraphPlace>) methods of the delegate, and they aren't getting called either. What am I doing wrong?
Thanks,
Can.
Found the answer: I wasn't creating the Facebook session before displaying the place picker. I totally forgot about the session. It'd be nice to see Facebook add an assertion check in loadData method of the picker for an existing Facebook session. I've created the session, and THEN tried my code, and it works perfectly now.

How to get driving directions within my app iOS6

I am using Apple Map's in my app and on my view i want to show the driving direction from the user location to the current location that i have on the view, now i just want all this inside my app only i.e i can show the driving direction's on the mapview, I have tried using the apple map application but after i make call to it from my application it takes me to apple's map application where i get the driving direction's but i can not return back into my application so i am thinking that i can do something in my application itself so that i can get the driving directions on my current view itself ..
NSString* addr = [NSString stringWithFormat:#"http://maps.apple.com/maps?daddr=%1.6f,%1.6f&saddr=%1.6f,%1.6f",coordinate.latitude,coordinate.longitude,mapView.userLocation.coordinate.latitude,mapView.userLocation.coordinate.longitude];
NSURL* url = [[NSURL alloc] initWithString:[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:url];
this code takes me to the apple's map app from my native app but i can't return directly back to my app.is there a possible solution so that i can move back to my APP AFTER GETTING THE DRIVING DIRECTIONS ?? (webview didnot work for me.can i add a back button on apple's app or what ).Please help.... Thanks a lot !!
Or Please can any one suggest me a better code for implementing so that i can do all of that in my application only ?
I want an in-app map depicting the navigation routes and driving directions...
This is not the way to achieve the directions,
I have made a sample for you which covers all the iOS versions, New Google Maps and the iOS 6 tom tom maps as well.
Here it is:
if([[[UIDevice currentDevice] systemVersion] compare:#"6.0" options:NSNumericSearch] == NSOrderedDescending){
//6.0 or above
NSString *Destinationlatlong =[NSString stringWithFormat:#"%#,%#",your.latitude,your.longitude];
NSString* addr = [NSString stringWithFormat:#"comgooglemaps://?saddr=%f,%f&daddr=%#",[AppDelegate zDelegate].location.coordinate.latitude,[AppDelegate zDelegate].location.coordinate.longitude, Destinationlatlong];
addr=[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL* url = [[[NSURL alloc] initWithString:addr]autorelease];
// NSLog(#"url %#",url);
if ([[UIApplication sharedApplication]canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}else{
CLLocationCoordinate2D coords =
CLLocationCoordinate2DMake([your.latitude doubleValue],[your.longitude doubleValue]);
MKPlacemark *placeMark = [[MKPlacemark alloc]
initWithCoordinate:coords addressDictionary:nil];
MKMapItem *destination = [[MKMapItem alloc]initWithPlacemark:placeMark];
[destination openInMapsWithLaunchOptions:nil];
}
}else{
NSString *Destinationlatlong =[NSString stringWithFormat:#"%#,%#",your.latitude,your.longitude];
NSString* addr = [NSString stringWithFormat:#"http://maps.google.com/maps?saddr=Current+Location&daddr=%#",Destinationlatlong];
addr=[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL* url = [[[NSURL alloc] initWithString:addr]autorelease];
// NSLog(#"url %#",url);
if ([[UIApplication sharedApplication]canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}else{
UIAlertView *alert=[[[UIAlertView alloc] initWithTitle:#"Warning!" message:#"Device does not support this functionality" delegate:nil cancelButtonTitle:#"Okay" otherButtonTitles: nil]autorelease] ;
[alert show];
}
}
This should get you started. In short, get driving instruction from google api in json, parse it, and display it on your own map using MKPolyline
http://iosguy.com/2012/05/22/tracing-routes-with-mapkit/

Why is my MPMediaItem NowPlayingItem returning null?

I am incorporating the iPod player in my app. I am able to create a queue, then play the songs. I am not able to get the current song's property values. I have registered for the notifications and the log shows the notifications are bing triggered.
MPMediaItem *currentItem = self.musicPlayer.nowPlayingItem;
NSLog(#"currentItem = %#", currentItem);
Log output shows: currentItem = (null)
I'm running Xcode 4.5.2 iOS 6.0.
Any help is greatly appreciated.
For anyone else who may run into the same issue, the problem was that I synced my Music after running my application. You need to observe for Library changes:
MPMediaLibraryDidChangeNotification
[[MPMediaLibrary defaultLibrary] beginGeneratingLibraryChangeNotifications];
You wrote NSLog(#"currentItem = %#", currentItem); in your codes but maybe you have not got a full understand of what MPMediaItem is.
MPMediaItem is not NSString, and that's why you got null here. MPMediaItem has a lot of properties including song title, album name and artist name. To access the properties of MPMediaItem such as the title, use valueForProperty: method.
NSLog(#"currentItem = %#", [currentItem valueForProperty:MPMediaItemPropertyTitle])
Something like this.
I also had the problem that I mixed by accident the application player
[MPMusicPlayerController applicationMusicPlayer]
and the ipod player
[MPMusicPlayerController iPodMusicPlayer]
I was using the iPodMusicPlayer for playing music and tried to adjust the volume of the applicationMusicPlayer by accident.
So just beware not to mix them unintentionally ;-)

Resources