Swift and Salesforce IOS SDK - ios

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

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.

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

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!

Can not find <coreaudiokit/coreaudiokit.h> in ios8 xcode6

I am trying to get the MIDI over BLE working as discussed at session 501 at the WWDC 2014.
I get an error "file not found" when trying to #import CoreAudioKit/CoreAudioKit.h framework
I have included the framework in the build menu and tried putting the #import line in the .h or .m ViewController file.
It recognizes and compiles CoreBluetooth/CoreBluetooth.h with no problems.
This is a brand new installation of Xcode 6 downloaded yesterday (13 Sept 2014)
I feel like Apple has not turned on the switch for CoreAudioKit for iOS.
Any guidance on what I am doing wrong would be most gratefully received.
Thank you,
Ken
CoreAudioKit is not compatible with the iOS Simulator. Run it on a device, and it should build just fine
I you want to use the simulator for some other tests (not related to midi over bluetooth) you can use a conditional import of the framework:
#ifdef __APPLE__
#include "TargetConditionals.h"
#if TARGET_IPHONE_SIMULATOR
#compatibility_alias CABTMIDICentralViewController UIViewController;
#elif TARGET_OS_IPHONE
#import <CoreAudioKit/CoreAudioKit.h>
#endif
#endif
You still have to do optional linking of the framework in your build settings since CireAudioKit is not available at all on the simulator (OS X) platform.

Push notification plugin for Cordova/PhoneGap-2.5.0 is not working

I am trying to enable push notifications on my cordava iOS application.
I am following this tutorial : Apple Push Notifications with PhoneGap .
The sample code on it works well but the problem is it uses and old version of cordova (2.1.0).
When i try to use the latest version 2.5.0 there are some problems.
1) There is no JSONKit.m/h class in the Cordova project. The pushnotifications plugin seems to need this class to work. However if i comment the line where this class is imported i solve the error of the non existing file. However i get some warnings...
2) After i ve commented the #import <Cordova/JsonKit.h> line the pushnotifications work only when the application is on the background. If the app is on the foreground and i send a push , the app with crash.
Any ideas?
Cordova 2.4+ doesn't have JSONKit.
What you should do is change this line :
#import <Cordova/JSONKit.h>
to
#import <Cordova/CDVJSON.h>
and it should work.

Crash with RevMob on iOS

I recently upgraded the RevMob SDK of my cocos2d project, using Xcode 4.5. Below is a code to show what I have done:
#import <StoreKit/StoreKit.h>
#import <RevMobAds/RevMobAds.h>
- (void) applicationDidFinishLaunching:(UIApplication*)application{
[RevMobAds startSessionWithAppID:#"my app id"];
//some code here...
}
On running the project, on device or simulator, the app crashes with this error:
+[RevMobAds startSessionWithAppID:]: unrecognized selector sent to class
However, one thing which might be useful, is that when I added the RevMob framework to my Xcode, it gave me compilation errors (using LLVM GCC 4.2) for which I followed this answer.
This method was included in version 5.0.0 (RevMob changelog), so make sure that the framework that you are using is at least 5.0.0.

Resources