where to implement setUserIdentifier function from crashlytics in swift - swift

I am new to swift.
I am now trying to implement crashlytics in to my app.
I have followed the tutorial to implement it for basic report but I want to implement userID so that I know who has problem using my app.
I have checked online and found setUserIdentifier function but I have no idea where to implement this function.
Do I need to call this function in every page or in app delegate.swift?
Please give me an example on how to implement this one function.
Thank you very much.

let phoneID = UIDevice.currentDevice().identifierForVendor.UUIDString
Fabric.with([Crashlytics()])
Crashlytics.sharedInstance().setUserIdentifier(phoneID)
I used this to solve the problem and get the phone id.

I would strongly discourage the #Jun-Luo 's approach of using UUUID.
Crashlytics.sharedInstance().setUserIdentifier("12345")
Crashlytics.sharedInstance().setUserEmail("mail#domain.com")
Crashlytics.sharedInstance().setUserName("AppUserName")
You can use any one of above to track the user. But its better to secure user privacy, hence all we need as a developer is a ID which we can easily tack back with our server side access.
Code Example
https://docs.fabric.io/apple/crashlytics/enhanced-reports.html

Related

Using other languages with Flutter

I have been working with flutter for a couple of months now and it seems that there isn't really too much to work on an app for back-end or advanced functionality. I love using Flutter to help me design the UI but I want to use another language to help me do some other stuff. For example, I want to display a full-screen camera page (almost like Snapchat) or like send a direct message to another user through the app. Do I even need another language to do stuff like this? I am not an advanced programmer. I just want to create simple applications that can process and store a little bit of stuff.
You can easily do the mentioned stuff in Flutter/Dart.
Check out Firebase Messaging for direct messages and SQLite to store information on user devices.
For saving data locally,
You can use SqlFlite, a plugin with the help of which you can easily store and manage your database.
For saving data on the backend, so that other users can also access it when necessary, like the one you mentioned in a comment (..food ordering app)..you can use Firebase
Firebase has all you need.
Link to firebase :- https://firebase.google.com/
When your data is stored on a cloud, you don't need to hard code anything, for example, about the food ordering app you mentioned, you can make use of variables, in which you can store the values. So that when the owner changes the price, it gets updated.

Flutter cross-platform application, load user specific functions

I am creating my first Flutter-application. I was wondering if there is a way for me to let the user choose what function he/she wants. Let me give an eksample.
User1 would like to get information about the weather, while another user (user2) would like to se information about the latest news.
My problem is that i would like to load these pages from an ekstern source.
I was thinking about using a WebView and retrieve a html-file from my server, but is there a smarter way of doing this. Maybe a more native way?
I have a hard time explaining this one, but i hope someone have a clever idea.
The proper way would be to create some API endpoints (read "links that return some info") like myserver.dmn/myapp/weather , myserver.dmn/myapp/news , return data in JSON format, and use this data to build native views. I advise to read something about solutions like Firebase or Parse-server to get familiar with what are you trying to achieve. For a simplest api to play with i advise "express"

Attach a photo to SMS/MMS message

How can the Apple Photo App attach photos to MMS messages? While everybody assumes that there is no way to do it, is there any work around for this? Some fellows recommend using copy and paste. Has anyone tried that before? If so can you please help me with sample code? I have an idea which I'm not sure can work: if we have the copy and paste code, can we implement it in one method using afterDelay code or something else?
I had a client request this as a feature in an app. Unfortunately, Apple doesn't trust us enough to give us this feature.
We ended up having to use an intermediate service to upload the photo and provide the URL as a link in the SMS. ImageShack and yFrog could be two such services (they have an API available), but it really depends on what you need in terms of security/privacy.

Sending Data to Website From iPhone

I'm creating an iPhone Game where I want the user to get a unique numeric code when they first launch the app, that way when a friend of that user opens it, he/she can input that code and both users can get rewarded. I haven't encountered any issues regarding that, however what I want to do is make it to where the app registers the code given to every user and saves it to a website of some sort. That way when the other user enters the code, it will load the data from that website and check if it's registered. How would I manage to save the data onto a website? and also What free website could I use for this without having a character limit on the body page?
-Thanks in advance
Your thinking is correct, in that you need to save your data somewhere online, but you don't really "save data onto a website" in the way that you're describing. "Free Website" services usually serve a different purpose entirely - that of serving up public html pages. Sure, they can take the form of a CMS (like wordpress.com or tumblr accounts), but using that as an interface for storing your application's data is not something they're typically designed to do.
For something like this, where you have a public iPhone app that requires secure access to custom strings, you really want to have control over your own web server (different than a domain name, btw), and interface with a database on that server. This will come at a cost, and will involve more code than you're likely to find someone to write for you on here. Sorry to say it, but hey if someone wants to prove me wrong I'd love to see it.
Because all you need to store & retrieve are random strings (basically referral codes... if I'm understanding correctly), your database needs are pretty simple. If you're not familiar with things like PHP / MySQL, and you don't want to learn, it might be worth reaching out to some server-side developers for help. Unless there's more to it than you describe, you can probably find someone to help you for relatively cheap.
Good luck - and I'm sorry there isn't a simpler answer for ya.
You can send data using NSURLConnection. Just create an NSMutableURLRequest and call its -setHTTPMethod: method with “POST” as the HTTP method. Then, set its body and header fields appropriately, and you can use NSURLConnection to send the data.

Calling cards iPhone application

I am newbie to iPhone development, I want to do a kind of POC which fulfill the following requirement.
It will be basically a calling card application where user will enter a toll free number followed by pin number. After entering a pin no. it will show the available contacts from the iPhone itself, user will select a desired destination number and call it.
I know this is a whole new native application, but can anyone guide me how I can start working on the same. I have collected a few information about what calling card is and how it works. I'm a bit confused about how can I get the information from calling cards service provider?. Do i need to call there API and how to do a code in the XCODE tool?
Please help me in this regard.
A quick google of calling card api's shows that most card companies have them, but they also don't publish them. Looks like you'll have to talk directly with them and get api specs. It may cost you? I'm guessing the actual API won't be very complicated... a couple of HTTP requests and a little bit of response parsing. You might want to look into asi-http-request for building the requests, and you can probably do most of the response parsing with NSStrings or NSXMLParser if they use XML.