I have had the following problem occur after updating to the latest Chartboost SDK in Xcode.
(void)didCacheInterstitial:(NSString *)location {
NSLog(#"interstitial cached at location %#", location);
(void)didDismissInterstitial:(NSString *)location {
NSLog(#"dismissed interstitial at location %#", location);
[[Chartboost sharedChartboost] cacheInterstitial:location];
The error messages i am getting are:
conflicting parameter types in implementation of 'didCacheinterstitial:': 'CBlocation vs 'NSString*'
cannot initilaze a parameter of type 'CBlocation' with Ivalue of type 'NSString*'
Any help fixing this would be appreciated.
The Chartboost iOS SDK changes the way named locations are defined. They should now be defined in the Chartboost.h header file. This means that the SDK delegate methods will receive type CBLocation instead of NSString
See this help site documentation for more details: https://help.chartboost.com/documentation/ios/namedlocations
There were a few other updates in that version, check out the changelog for more info.
Related
I am very new to app development. I was trying to configure my GoogleSignInButton Callback function.
I get the error:
No active configuration. Make sure GIDClientID is set in Info.plist.
However, my Info.plist defines GIDClientID along with the value generated as advised here
OS: Version 13.0 Beta
Xcode: Version 14.1 beta 3
In order to resolve this issues, you don't need to add anything into the info.plist. you need to setup GIDSignIn.sharedInstance.configuration = config
https://github.com/WesCSK/SwiftUI-Firebase-Authenticate-Using-Google-Sign-In/blob/starting/README.md#updated-steps-for-v700-of-google-signin
guard let clientID = FirebaseApp.app()?.options.clientID else { return }
// Create Google Sign In configuration object.
let config = GIDConfiguration(clientID: clientID)
GIDSignIn.sharedInstance.configuration = config
....
Google documentation at Firebase Login methods is worse than....
So, if you are using 8.6.0 you can use GIDSignIn.sharedInstance.signIn(withPresenting: presentingVC), but add ClientID in Info.plist like here:
enter image description here
Regarding the main issue, from your picture I see that you put the URLSchema at GIDClientID, they are a little bit different.
Eg. GIDclientID: xxxx-xxxxxx.apps.googleusercontent.com
URLSchema: com.googleusercontent.apps.xxxx-xxxxxx.
Try like that.
I get my clientId using this line of debug in my code
guard let clientID = FirebaseApp.app()?.options.clientID
Same error. I'm newbie too, it helped for me to reinstall packages (GoogleSignIn and FirebaseAuth) with older versions (6.0.0 and 8.6.0) so GIDSignIn.sharedInstance.signIn(with: config, presenting: self) is available. This is a temporary solution till we find working way.
Don't add new property named "GIDClientID" into the Info.plist of target project, use CLIENT_ID which is defined in GoogleService-Info.plist instead.
Find more details here:
https://stackoverflow.com/a/74897652/19683708
This changes in google sign is new. Also GIDSignIn.sharedInstance.signIn(with: config, presenting: self) is not available anymore. GIDSignIn.sharedInstance.signIn(withPresenting: presentingVC) replaced it. But I got same error. Hope to someone find an answer
I am unable to view analytics debug view after I install the app through TestFlight into my test phone.
I have passed in argument -FIRDebugEnabled, and have tried -FIRAnalyticsDebugEnabled but no luck.
-FIRDebugEnabled
-FIRAnalyticsDebugEnabled
If I directly installed the app into my test phone through Xcode, the debug view will be available. But if it's installed through TestFlight, the debug view cannot be seen.
This can be done by injecting special flags into Firebase's local storages. -FIRDebugEnabled command line argument is being checked by both: FirebaseCore and FirebaseAnalytics frameworks. While the former is saving the flag into shared UserDefaults, the latter is using APMUserDefaults private class, which can be accessed in runtime:
if let APMUserDefaults = NSClassFromString("APMUserDefaults") as AnyObject?,
let userDefaults = APMUserDefaults.perform(#selector(getter: UserDefaults.standard))?.takeUnretainedValue() {
_ = userDefaults.perform(#selector(NSMutableDictionary.setObject(_:forKey:)),
with: true,
with: "/google/measurement/debug_mode")
}
UserDefaults.standard.set(true, forKey: "/google/firebase/debug_mode")
Add following code at the first line of application:didFinishLaunchingWithOptions: method of AppDelegate file
CommandLine.arguments.append(contentsOf: ["-FIRDebugEnabled", "-FIRAnalyticsDebugEnabled"])
Add the following code before FirebaseApp.configure():
var newArguments = ProcessInfo.processInfo.arguments
newArguments.append("-FIRDebugEnabled")
ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
Then, go to your target's build settings and update Release's Optimization level to No Optimization [-Onone].
After that, upload to TestFlight. This method works for me!
The iOS 8 Extension SDK allows you to interact with a web pages using JavaScript.
The guide references a kJavaScriptFinalizeArgumentKey constant to use as a dictionary key when passing data back to the finalize() method in the JS.
Xcode doesn't recognise this, nor the other kJavaScriptResultsKey referenced in the docs.
Does anyone know if this is either not yet implemented, or if I need to import a module for this to work?
replace 'kJavaScriptFinalizeArgumentKey' with 'NSExtensionJavaScriptFinalizeArgumentKey'
so the SDK sample should be
NSExtensionItem *extensionItem = [[NSExtensionItem alloc] init];
extensionItem.attachments = #[[[NSItemProvider alloc] initWithItem: #{NSExtensionJavaScriptFinalizeArgumentKey: #{#"bgColor":#"red"}} typeIdentifier:(NSString *)kUTTypePropertyList]];
[self.extensionContext completeRequestReturningItems:#[extensionItem] completionHandler:nil];
I'm trying to authenticate the local player using swift, but every time I get a false value for the .authenticated property. Here is the code I'm using, it is called by the main view controller when the app starts.
func authenticateLocalPlayer(){
var localPlayer = GKLocalPlayer()
localPlayer.authenticateHandler = {(viewController, error) -> Void in
if viewController {
self.presentViewController(viewController, animated: true, completion: nil)
}else{
println((GKLocalPlayer().authenticated))
}
}
}
It brings up the log in view just fine, but when I enter a test account login, it just returns the GKLocalPlayer().authenticatedas false. The bundle identifier in iTunes Connect and the info.plist are exactly the same, as is the version and the app name. Everything is enabled for Game Center on iTunes Connect and in Xcode, but I have a feeling it's not a coding error, it's a setup error in the app record somewhere but I can't for the life of me find where.
After further tinkering, I'm getting this error:
Error Domain=GKErrorDomain Code=15 "The requested operation could not be completed because this application is not recognized by Game Center." UserInfo=0x17006b300 {NSLocalizedDescription=The requested operation could not be completed because this application is not recognized by Game Center.}
I have no idea why this is the case, the bundle ID, name and versions all match...
Any help would be greatly appreciated.
This issue has been resolved by Apple - just call:
GKLocalPlayer.localPlayer()
Previously, the issue was that GKLocalPlayer() does not return the GKLocalPlayer singleton, but instead returns a new GKLocalPlayer instance.
If you were on the Xcode 6 BETA, you could add a C function or Objective-C method that returns the real GKLocalPlayer singleton, then use this in Swift. This is the gist of my workaround (with bad naming conventions):
In an Objective-C header:
GKLocalPlayer *getLocalPlayer(void);
In an Objective-C implementation:
GKLocalPlayer *getLocalPlayer(void) {
return [GKLocalPlayer localPlayer];
}
In your bridging header:
#import "ThatHeader.h"
Then whenever you need to access the GKLocalPlayer singleton in Swift, you can just use getLocalPlayer() instead of GKLocalPlayer(). It's probably a better idea to stick that in an method of a GKLocalPlayer category.
However, this is no longer necessary as detailed above.
Even with Xcode 6 Beta 6, on a device using iOS 8 beta 5, making GKLocalPlayer.localPlayer() available, I was still getting the error:
"NSLocalizedDescription=The requested operation could not be completed
because this application is not recognized by Game Centre"
The solution (discovered through Apple's Dev forum) was to go to "Settings" on the device, and then into "Game Centre" and enable "Sandbox" under the developer section.
You can use that, I create a simple class for iOS game center in GitHub
Easy Class Game Center Swift
https://github.com/DaRkD0G/Easy-Game-Center-Swift
I am adding Tapjoy SDK code to my app, When I run app,
I get this error code:
property 'showFeaturedBtn' not found on object of type 'UIViewController *'
My code I am calling:
// Show the custom Tapjoy full screen featured app ad view.
if (featuredApp)
{
[TapjoyConnect showFeaturedAppFullScreenAdWithViewController:mainCtrl_];
[mainCtrl_.showFeaturedBtn setEnabled:YES];
[mainCtrl_.showFeaturedBtn setAlpha:1.0f];
}
}
Where it says:
[mainCtrl_.showFeaturedBtn setEnabled:YES];
[mainCtrl_.showFeaturedBtn setAlpha:1.0f];
I get 2 errors that say:
property 'showFeaturedBtn' not found on object of type 'UIViewController *'
Is there a solution?
showFeaturedBtn is something specifically in the Tapjoy sample application and not in the Tapjoy SDK explicitly. So you can't make reference to it in your application. This is why you're getting errors.