Google Mapspod 'GoogleMaps'
Fazer o Estilo Abrir JSON de configuração Carregar o mapa
https://mapstyle.withgoogle.com/
Google Mapspod 'GoogleMaps'
import UIKit import GoogleMaps
class ViewController: UIViewController, GMSMapViewDelegate {
override func loadView() { let panoView = GMSPanoramaView(frame: .zero) self.view = panoView
panoView.moveNearCoordinate(CLLocationCoordinate2D( latitude: -33.732, longitude: 150.312)) } }
var ref: FIRDatabaseReference!
ref = FIRDatabase.database().reference()
self.ref.child("users/(user.uid)/username").setValue(username)
ref.child("users").child(userID!).observeSingleEvent(of: .value, with: { (snapshot) in // Get user value let value = snapshot.value as? NSDictionary let username = value?["username"] as? String ?? "" let user = User.init(username: username)
// ... }) { (error) in print(error.localizedDescription) }
Firebase Cloud Messaging
Não esquecer de pedir autorização no Delegate
pod ‘Firebase/Core’ pod ‘Firebase/Messaging’
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max) { UIUserNotificationType allNotificationTypes = (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge); UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings];} else { // iOS 10 or later #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 // For iOS 10 display notification (sent via APNS) [UNUserNotificationCenter currentNotificationCenter].delegate = self; UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge; [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) { }];
// For iOS 10 data message (sent via FCM) [FIRMessaging messaging].remoteMessageDelegate = self; #endif}
[[UIApplication sharedApplication] registerForRemoteNotifications];
remoteConfig = FIRRemoteConfig.remoteConfig() let remoteConfigSettings = FIRRemoteConfigSettings(developerModeEnabled: true) remoteConfig.configSettings = remoteConfigSettings!
remoteConfig.setDefaultsFromPlistFileName(“RemoteConfigDefaults")
remoteConfig.fetch(withExpirationDuration: TimeInterval(expirationDuration)) { (status, error) -> Void in if status == .success { print("Config fetched!") self.remoteConfig.activateFetched() } else { print("Config not fetched") print("Error \(error!.localizedDescription)") } self.displayWelcome() }
var welcomeMessage = remoteConfig[welcomeMessageConfigKey].stringValue
- (IBAction)inviteTapped:(id)sender { id<FIRInviteBuilder> inviteDialog = [FIRInvites inviteDialog]; [inviteDialog setInviteDelegate:self];
// NOTE: You must have the App Store ID set in your developer console project // in order for invitations to successfully be sent. NSString *message = [NSString stringWithFormat:@"Try this out!\n -%@", [GIDSignIn sharedInstance].currentUser.profile.name];
// A message hint for the dialog. Note this manifests differently depending on the // received invitation type. For example, in an email invite this appears as the subject. [inviteDialog setMessage:message];
// Title for the dialog, this is what the user sees before sending the invites. [inviteDialog setTitle:@"Invites Example"]; [inviteDialog setDeepLink:@"app_url"]; [inviteDialog setCallToActionText:@"Install!"]; [inviteDialog setCustomImage:@"https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"]; [inviteDialog open]; }
Mais informações
Route 85
http://bit.ly/route85
Google APIs para iOS
https://developers.google.com/ios/
Firebase in a Weekend by Google: iOS http://bit.ly/FirebaseiOSWeekend
Top Related