See if message is read/unread in Sinch messaging - parse-platform

I'm using Sinch! Instant Messaging together with Parse-server in my application. Is there a good way to mark a message object as "read" without actually first saving it to the backend, and then pulling it down on the other side and mark is at read, and then re-saving it to the same backend, but now as "read" instead of "unread"?
I want the users to be able to see if they have read a message or not, so new message are highlighted. Is there an easy way to do this with Sinch? Or any suggestions on how to do this effectively?

we dont have read, but i dont see why you would need to save it to your backend first. I would mark them as read locally as soon as they are in you IM view

Related

How to make UILabel "live"?

I would like to add text to my app so when ever I want to change the text in Xcode, the text will also change for the user. From my understanding so far, if I want to change a UILabel, I would have to submit it to the AppStore again and the user would have to update the app in order to see the UILabel text change.
Is it possible for me to add text on the app when ever I want and it will update for the user automatically?
First you should consider the solution, that will be connecting your app to certain API service.
In other words, the service that will bring fresh data to your app, will be an API, that your code will connect to. After connection and getting response from server, data from it will be transferred to the user interface of your application.
For example - your code will be set to make requests from your app using URL, looking like this:
http://example.com/api/request/?id=100
For better imagination, if you would like to check, what this URL returns, you would type that URL to your browser. It would return some output - for example JSON, something like this:
{"label": "This is title"}
So your app (after some action, for example when a view is shown or a user taps a button) will establish connection to this URL, to be able to get this output and process it. So it will await some structure, that is needed to read by your program. In this case, the structure is a format of an output, that is JSON.
Then, your code will parse this output and gets result. So the result would be "This is title" and your UILabel would be updated with "This is title".
For URL connections and sessions, using swift3, the best choice to use is an Alamofire framework:
https://github.com/Alamofire/Alamofire
And this is very useful tutorial:
https://www.raywenderlich.com/121540/alamofire-tutorial-getting-started.
It explain, how to get an access to a service, that is capable to prepare your output (e.g. JSON), because your app will need to connect to it.
This tutorial is a solid guide, how to create a service like that.
You have to implement web services for this where your app will read data from some server, programmatically. And using this you can update your any type of data. I would suggest to read more about Objective C Basic, Web services, AFNNetworking, NSURLSession and all.

Post-email-verification hook

In express-stormpath, what's the best way to run some code after a successful email verification?
postRegistrationHandler comes close, but it gets called before email verification.
We don't yet have a hook for this, although we're working on writing a new events system at some point in the future, at which point this will get added =)
If you'd like to get us to add this feature, leave a comment on our Github tracker here: https://github.com/stormpath/express-stormpath/issues (we listen to feedback!)

Restrict or Obscure data sent to Application Insights

we have just added Application Insights to our WebAPI 2.2 application and it looks like a winner.
However, we have some controllers that receive sensitive information that we cannot store due to compliance regulations, even in Application Insights. We want to capture information level trace events on some of our controllers, but we need to not capture or obscure the information when sent through other controllers. Can anyone suggest a way that we can achieve that?
Since you're using the Microsoft.ApplicationInsights.TraceListener package, I don't think there's any way to directly filter the data. If you can add something special to the Trace.WriteXxx() call, then one option might be to implement a TraceFilter and register it through your configuration for the ApplicationInsights Trace Writer.
Then in your TraceFilter.ShouldTrace(), you could check for that special value (maybe it's the event ID, maybe some prefix in the trace message, or something like that) and simply return false to cause it to be skipped.
I asked the same question on the Azure MS website and got a reply that works well.
Anyone looking here for an answer should look there.
https://azure.microsoft.com/en-us/documentation/articles/app-insights-get-started/#comment-2309233065

Using saveEventually() instead of save() or saveInBackground() for ParseUser or ParseObject

Looking at Parse documentation, there is a saveEventually() method that can be used in place of save() and saveInBackground().
Can I use this function everywhere in my code in place of save and saveInBackground so I don't have to worry about the user switching between being offline and online and I won't have to handle saving in situations where there is no connectivity? Are there any drawbacks to using this approach?
According to Parse's iOS guide:
Most save functions execute immediately, and inform your app when the save is complete. If you don't need to know when the save has finished, you can use saveEventually instead. The advantage is that if the user currently doesn't have a network connection, saveEventually will store the update on the device until a network connection is re-established. If your app is closed before the connection is back, Parse will try again the next time the app is opened.
So you will use save if you need the callback when the save has finished. I think you can use both depending on the situation you are handling.

BackgroundTransferService: what are some of the details of its operation?

I kick off 5 uploads (of varying size) via the BackgroundTransferService. I have the following questions about the way it works:
It seems that on the emulator it does 2 uploads at a time. Is this how it works on the actual device? Can I programmatically change this behavior?
Can I count on the uploads going out in the order that I submitted them? I seem to be getting conflicting results in my testing.
When I inspect the BackgroundTransferService in my application, does it contain requests from other apps as well or just mine?
Do I need to reconnect events for all the BackgroundTransferRequest objects when coming back from being tombstoned? What about coming back from being reactivated?
Do I need to disconnect events from the BackgroundTransferRequest when I remove it from the BackgroundTransferService.Requests collection?
When I try to upload a non-existing URL:Port (on the localhost), the TransferStatus is reported as WaitingForNonVoiceBlockingNetwork. The upload never actually completes/fails. Is this how it is on the device? Should I remove the request when it encounters this TransferStatus?
You cannot influence the behaviour of the BTS. If you don't like the way it works you can write the transfer functionality as part of your own application but then you have to handle running in the background yourself.
There is no guarantee on sequence.
The BTS may be handling requests from other apps but you won't be able to see the details. Requests() will only return details for your app.
Surely a quick test will tell you this.
It's good practice to.
Have you checked the TransferError property whe you reach this situation? This is a perfectly valild status in other situations and so you shouldn't treat this as a automatic fail.

Resources