Error message:
'PFAnalytics.Type' does not have a member named 'trackAppOpenedWithLaunchOptions'
All other similar functions work, e.g. trackAppOpenedWithLaunchOptionsInBackground. It looks like that it just simply disappears from the list of available functions.
But in my PFAnalytics.h header file, trackAppOpenedWithLaunchOptions
is clearly listed as shown below:
+ (BFTask *)trackAppOpenedWithLaunchOptions:(NSDictionary *)launchOptions;
What might have been wrong? Please help! I am using swift
The method is declared to return a BFTask *
object, which is part of the Bolts framework. Make sure your project is linking the Bolts framework, and then add
#import <Bolts/Bolts.h>
to your bridging header.
This solved a few "missing" APIs in Swift for me (this one, as well as PFObject.saveInBackground
mentioned here: PFObject does not have a member named 'saveInBackground' in Xcode 6.0.1, Yosemite GM3
Try
PFAnalytics.trackAppOpenedWithLaunchOptionsInBackground(launchOptions, block: nil)
instead of
PFAnalytics.trackAppOpenedWithLaunchOptions()
No need for bridging headers since release 1.0. To fix the issue, just add, import Bolts
at the top of your AppDelegate
as such:
import UIKit
import Parse
import Bolts
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With