I deleted my installation class in the Parse Data Explorer, and created a new one. Now that it's empty no new installations are appearing in the class. What is causing this behaviour, and how can i fix it. Did Parse implement some kind of function to call in the iOS SDK before an installation can appear?
Any help is appreciated! :)
If you delete records from Installation table, the records will not appear again when you open your App. This easy fix is to delete the App from your device and re-install it for a device Installation record to appear again in your class. This is possibly because when you register an installation it gets cached locally by the Parse SDK on your device and will not be updated again.
I tried to do the push guide from Parse again, and it seemed like they changed some thing in the SDK, which caused the problem!
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
PFPush.storeDeviceToken(deviceToken)
let currentInstallation = PFInstallation.currentInstallation()
currentInstallation.setDeviceTokenFromData(deviceToken)
currentInstallation.channels = ["global"]
currentInstallation["notifyEnabled"] = true
currentInstallation.saveInBackground() //This line was not there initially!
}
I fixed it by inserting the line highlighted in the code.
Thanks for the all the help! :)
Related
I have setup firebase in both the console and in the app. Everything configures correctly, and events appear to be logging in the app.
Output to console:
<FIRAnalytics/DEBUG> Logging event: origin, name, params: app,
log_something, {
"_o" = app;
"full_text" = khbsdpibdsjl;
name = lwkjbgskljsavdkjl;
}
I have the debug flag enabled: -FIRDebugEnabled.
Yet in the debugging events console there is NOTHING. I see no devices available, no events being logged, absolutely 0 indication of anything connected. I must be missing something?
edit: I have been following this for setting up Debugging Events. https://firebase.google.com/docs/analytics/debugview#enabling_debug_mode
I am seeing events in the StreamView, but nothing in the debug view even though I have debug mode enabled.
Try this , This is work for me ,
Follow below steps ,
1.In Xcode, select Product → Scheme → EditScheme.
2.Select Run from left Menu and Select Arguments tab
In the Arguments Passed on + option
add -FIRDebugEnabled
For detail debug view follow steps DebugView track Firebase doc
To send an event in Xcode project follow code below,
Objective C
[FIRAnalytics logEventWithName:#"share_image"
parameters:#{#"name": name, #"full_text": text}];
Swift
Analytics.logEvent("share_image", parameters: ["name": name, "full_text": text])
For events log follow detail steps Log events in Application Firebase doc
Hope this will help someone.
Make sure to remove the OS_ACTIVITY_MODE:disable from the Environment Variables in your project scheme if you added it at some point.
Make sure to add ONE DASH before -FIRDebugEnabled
I wasted a whole day making silly mistake having missed that DASH
Hope that doesn't happen to others!
Now it doesn't matter much but still for the people who are getting errors on this issue. Debug mode of firebase analytics does not work sometimes due to issue in GoogleServices-Info.plist file
Simply makes these 2 changes.
Set IS_ANALYTICS_ENABLED to YES
Set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE to NO
I also have the same problems.
1 check your Cocopods' s Firebase version.
use pod update Firebase
List item
make sure that is the latest
2 open debug mode
In the Arguments Passed On Launch part
add - FIRDebugEnabled.
I made it possible by writing the following:
func application(_ application: UIApplication, didFinishLaunchingWithOptions, ...) {
// some other initialization
FirebaseApp.configure()
Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}
Alternatively you can do that inside your AppDelegate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
var newArguments = ProcessInfo.processInfo.arguments
newArguments.append("-FIRDebugEnabled")
ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
}
---EXTRA---
And just some thoughts:
Regarding
Firebase.Analytics.setAnalyticsCollectionEnabled(true)
If we inspect the method:
So it's kind of POINTLESS...
Check if you have an ad blocker enabled while visiting the Firebase website.
I had uBlock origin enabled and it would block every page (Dashboard, Events, StreamView, DebugView...) and they'd all be blank.
Everything worked as expected as soon as I whitelisted it.
I recently had an issue where the Xcode console said everything was fine, and all was being logged and sent, and I had the "-FIRDebugEnabled" and I tried all other suggestions in this thread, but nothing worked.
Nothing was being sent to Firebase's DebugView.
Looking through my git-history, I determined the issue occurred due to a pod update, and the solution to my issue was another pod update.
I don't know which pod had failed, but I suspect either Moya, Alamofire or FirebaseAnalytics... after this, I'm strongly considering locking my pod-versions.
I had the same configuration as jaywant-khedkar, but no events or devices were showing up in the Firebase Debug View.
Found out that my pi-hole on my network was eating all the events.
So if if you have any kind of ad blocker on your network, disable it and try again.
Happy debugging!
If you've done everything that the Firebase documentation states, then it could be that you have the wrong "Debug Device" selected in Firebase Analytics' "Debug View". After changing the debug device in the top left, all my analytics events from before were displayed! So it wasn't that my events weren't being sent to Firebase, I was just seeing the wrong view. Image attached.
Had this issue a few days ago, after trying every solution I found on the internet and none of them working, these are the steps I used to finally enabled DebugView to find my device:
Close the app on the device you’re working on
Go to the Firebase console and sign out of your account
Sign back in again, go to the console and select the project you’re working on.
Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.
It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.
Bonus tip:
Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...
When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.
I'm trying to get the url for my contrainer ID but the method keeps returning nil.
I've done the following:
Enabled iCloud Key-value storage in Xcode capabilities.
testing on a physical device.
iCloud, and iCloud Drive turned on in the physical device.
Made sure that iCloud Key-Value Store is added to the entitlements file.
My code is:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//Override point for customization after application launch.
let cloudURL = FileManager.default.url(forUbiquityContainerIdentifier: nil)
print(cloudURL as Any)
return false
}
I have looked for almost all of the questions that are related to this issue and tried the answers but it's not working.
For Xcode 9.2, checking this option worked:
iOS10.3
I had same problem, fix it by following steps:
1.go to physical device's setting -> iCloud. turn off iCloud Drive and turn it on again, find your app in iCloud Drive, turn off and turn on.
2.shut down your device, and restart it.
Then it worked, I'm not sure which part make it worked, hope for help.
Try this :
Inside the Settings app, under the 'iCloud' menu. I noticed that 'Documents & Data' was set to Off.
Solution was to change ('Documents & Data' to 'On'.
I have an issue with registerDefaults of NSUserDefaults with a settings bundle. Perhaps others have dealt with this issue and simply ignored but it's hit a point where I'm convinced this is either a bug or we're approaching the issue incorrectly.
Create a new dictionary and register it.
Launch the app.
Go to iOS Settings App
Go to your app settings and see the only things visible are location and camera.
Previous solution: Swipe up on the settings app to close and relaunch it then all of the settings appear.
Obviously this isn't ideal and although we have been dealing with the issue ever since iOS 7 I believe I am ready for a real solution since it's become more problematic for support lately. Has anyone had this work on first launch and if so, can you please share your technique?
Things we've tried.
Moving the register function to init() = same result
Calling register after didFinishLaunching = same result
Only add one option to narrow down issue = same result
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
var appDefaults = Dictionary<String, AnyObject>()
appDefaults["some_setting"] = true
appDefaults["some_setting2"] = false
NSUserDefaults.standardUserDefaults().registerDefaults(appDefaults)
NSUserDefaults.standardUserDefaults().synchronize()
return true
}
This was FINALLY fixed in iOS 10 with no changes necessary to the code above. THANK YOU APPLE!
I'm working on an app that has push notifications enabled. My app it's using push notifications since day 1 with parse.com as the server.
Everything was working fine, I did several app updates and improvements and I had always receive one notification for each push sent by the server, I've also updated from parse 1.7.2 to 1.12.0 without having issues.
Because parse.com was going to terminate its services, I started the migration from parse to Urban Airship (using 7.0.2).
I did several tests, installing and uninstalling the app on my phone, installing the production version (using parse) and installing the development version (using urban airship), everything was working fine, when suddenly and I don't know why, I started receiving 5 notifications per push sent by the server. I thought it was a parse.com problem because at that time my iPhone was running the production version (with parse), but it was not.
When the version (using Urban Airship) was just published, I kept receiving 5 notifications.
I'm totally lost here, I don't have any clue why this is happening, at first I thought it was related with the several installs and uninstalls of the app, so I try:
1. Disabling notifications.-
2. Deleting the app.-
3. Disabling notifications
3.a. deleting the app
3.b. then changing time and date ahead a couple of days
3.c. then turning off the phone
3.d. turning on again and putting the right date
3.e. restarting the phone
3.f. installing the app
None of those worked so far. And I couldn't find anything online about this issue that was clear or solve this issue.
I hope someone could help me.
Extra info:
Swift 2
iOS 8.0+
XCode 7
Pushes are sent by a PHP Server
My AppDelegate.swift (Please notice that I have only included the relevant code, the rest of the code is not related):
import UIKit
import CoreData
import AirshipKit
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let config: UAConfig = UAConfig.defaultConfig()
UAirship.takeOff(config)
UAirship.push().userPushNotificationsEnabled = true
UAirship.push().resetBadge()
// Get the user settings
let userSettings = NSUserDefaults.standardUserDefaults()
var notify = userSettings.dictionaryForKey("notifications")
let appReset = userSettings.objectForKey("appResetv200")
if appReset == nil {
notify = nil
userSettings.setObject("done", forKey: "appResetv200")
}
if notify == nil {
let notificationTypes = [
"notType1" : true,
"notType2" : true,
"notType3" : true
]
userSettings.setObject(notificationTypes, forKey: "notifications")
UAirship.push().addTag("notType1")
UAirship.push().addTag("notType2")
UAirship.push().addTag("notType3")
UAirship.push().updateRegistration()
}
return true
}
}
I hope someone can help me, everything worked fine when I did the tests on my development environment, and now it's a complete mystery why it's failing.
I want to use Crashlytics on my application. I followed every step but I'm stuck on "Verifying Installation..." step.
What is the problem ?
setDebugMode = YES
set below code before [Fabric with:#[ TwitterKit ]]; if applied for twitter kit. Or you can simply past below code in didFinishLaunchingWithOptions.
// Swift
Crashlytics().debugMode = true
Fabric.with([Crashlytics.self()])
// Objective-C
[[Crashlytics sharedInstance] setDebugMode:YES];
[Fabric with:#[[Crashlytics class]]];
Now build and run your app and check fabric UI window, it will move ahead to complete screen.
I resolved the problem.
I put my code in applicationDidFinishLaunching(application: UIApplication) instead of func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?)
It seems silly but sometimes you need to make a code change (like a simple NSLog statement) to kick the verification.
If you're adding a new app you need to be an Admin of your organization but you may just be a User.
Just had the same issue on Mac.
In my case the guide shown in the Fabric application was completely missing a crucial step: there was nothing about adding the API key!
So make sure your API key is added to info.plist, otherwise the application gets stuck at verifying installation.
Simply login to Fabric and follow this manual installation guide to make sure everything gets done correctly. Once you complete the last step you can go straight to the dashboard.
I have occurred the same problem. I run the app on iPhone. After I deleted the app and pressed CMD + R on iPhone, the problem is solved.
If you have already installed twitter/Digits kit using fabric before, then you will find Fabric.with([Digits.self, Twitter.self]) in your "AppDelegate.swift" file . Replace it with the following code Fabric.with([Digits.self, Twitter.self, Crashlytics.self]) if you want to use all three. Now press Cmd + R to finish the installation.
Another possible solution is to run the app with connectivity on the device/simulator, as indicated in here.
It could be that the app was already added to your team's account and that all you needed was an access to it. Here's a thread about the same issue: https://twittercommunity.com/t/hmmm-seems-like-your-kit-isnt-activating/73601/9.