SWIFT 2: Class ViewController has no initializers - Using GOOGLE's Admob - ios

I was following a Youtube tutorial to learn how to use Google's AdMob with Swift on XCode: https://www.youtube.com/watch?v=tJi-vQ9e-HI
I got an error saying that my class "ViewController" has no identifiers.
It had worked just fine for the guy on Youtube, we put in the same frameworks, imported the same frameworks, wrote the same code. The only difference I believe is that he was developing for iOS 9.1 while I was doing it for 9.3.
The picture linked below has my code for the ViewController.swift file and I do not know what is wrong with it.
Any help is appreciated.
Thanks!
ViewController.swift

You didn't initialize the banner before loading the view, you have to make sure it exists. So this should fix it:
var adBanner: GADBannerView!

Related

Customising Firebase Crashlytics crash reports

I am trying to customise Firebase Crashlytics reports by adding a couple of custom keys. I followed instructions from https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios
The iOS app is based on React Native. I have added dollowing in one of the methods of RNSPlashScreen.m:
[[FIRCrashlytics crashlytics] setCustomValue:templateVersion forKey:#"template_version"];
But I get following error:
Use of undeclared identifier 'FIRCrashlytics'
I tried adding:
#import FirebaseCrashlytics;
But then another error popped up:
Module 'FirebaseCrashlytics' not found
Although I can confirm that I have followed all steps as mentioned in the documentation and I am able to get the crash reports in Firebase console. I have also added use_frameworks! in my podfile.
I am facing issues in adding customer keys for the more detailed reporting. Any help will be appreciated.
I managed to make it work. Let me start by saying, I'm a newbie in iOS development. I was adding the tracking code in SplashScreen which was the primary concern I believe. I moved it to RootView class and it solved the issue.
About the import error, Replacing #import FirebaseCrashlytics; with #import "FIRCrashlytics.h" did the trick.
Let me know if anyone has any suggestion or comment on the same.

Firebase/Admob installation guide with pods on Cocoapods site vs Firebase installation guide on google

I'm trying to integrate firebase/admob ads for ios app using Cocoapods.
On Cocaopods site there is a guide such as downloading Cocoapods first then creating a pod file in the app and adding a code using pods. On Google site there are also instructions on how to install firebase ads sdk using pods but then it seems that I also need to insert coding such as gad etc in the actual application. I'm new to this, so I'm a bit confused - is Cocoapods coding enough or do I also need to add coding in the application as well in terms of initializing ads or creating buttons for specific ads such as banner/interstitial etc?
You have to add some coding in the app as well such that importing the Googlemobileads in the app delegate and configuring it in the func didFinishLaunchingWithOptions:
GADMobileAds.configure(withApplicationID: "Your application id")
and then adding the below code in your first controller or the controller in which you want to show the adds:
var bannerView: GADBannerView!
bannerView = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
bannerView.frame.origin.y = self.view.frame.size.height - bannerView.frame.size.height
self.view.addSubview(bannerView)
bannerView.adUnitID = "Your ad unit id"
bannerView.rootViewController = self
bannerView.load(GADRequest())
Also, I think the code is in C that's why I had problems with it and not Swift. I've managed to get almost everything done - I have a problem when I use self.bannerView and also GADBannerView with messages that it hasn't been declared previously. I tried to follow Objective C because that's how the code looks like, but don't seem to be able to resolve this.

Pinterest SDK: "PDKClient not found", what's wrong?

I'm trying to implement Pinterest SDK into my Swift project. I've followed this install guide: https://developers.pinterest.com/docs/sdks/ios/
I just can't get this line working:
PDKClient.configureSharedInstanceWithAppId("0000")
It keeps on resulting to Use of unresolved identifier PDKClient
What should I do?
You need to import the PinterestSDK in the class (I guess AppDelegate, right?).
So, at the top of AppDelegate, add
import PinterestSDK
Then it should find the PDKClient object.

No visible #interface for 'SCLFlicManager' declares the selector 'requestButtonFromFlicAppWithCallback:'

I have an error for developing flic iOS app.
value of SCLFlicManager has no member requestButtonFromFLicAppWithCallBack.
Can anybody send me sample app for flic .How to configure flic functionality within our apps? please help
I read and followed tutorial, but it giving me error that SCLFLicManager has not that methods . So I think is SDK wrong? Because methods which are used in that tutorial are not there in header files. So What I have to do?
I attached screenshot of my apps

Swift and Salesforce IOS SDK

I am trying to create a connected app with Salesforce IOS SDK and Swift and followed the steps mentioned in the https://www.youtube.com/watch?v=9Mt02DzsOBo but as try to attach the "Appname-Swift.h"file in the AppDelegate.m file I am getting an error.Please help what can be done next.
1)I have created the native connected app as per Salesforce IOS
Description
2)Created the bridge for Swift
"MySampleApp-Bridging-Header.h"
3)Added SFRestDelegate to RootVC.Swift
4)Imported the important header files to
"mySampleApp-bridging-Header.h" that is
#import <UIKit/UIKit.h>
#import "SFRestAPI.h"
5)As soon I am trying to import #import "MySampleApp-Swift.h" I am getting the error
I am using OSX mavericks with XCode-6(4beta)
I don't think in the video or in the sample code repository there is a file named MySampleApp-Swift.h

Resources