It there any way to find out is incoming call screen is being shown over my application? - windows-phone-7

It there any way to find out if there is an incoming telephone call screen being shown over my application? In fact, while we wouldn't accept call - the application would not be deactivated, so is there any API method or maybe some workarounds like screenshoting and verifying by pixel ? :-)

You can tell if the user is receiving an incoming telephone call using the RootFrame.Obscured event as described here:
http://www.wintellect.com/CS/blogs/jprosise/archive/2011/02/11/silverlight-for-windows-phone-programming-tip-6.aspx

Related

Is there a way to suppress incoming notifications in Xamarin (iOS)

At work I have to modify an existing Application to differentiate incoming push notifications by the language of the news.
In Android I found a way to not send the push notification. So I could easily check for the language and only send the right one.
In iOS it seems a little different. (I'm not the Author of the existing code, so maybe I have overlooked something.)
But I can't find any function where I could intercept the incoming message.
I tried functions like UNUserNotificationCenter.Current.RemoveAllPendingNotificationRequests();
and
UIApplication.SharedApplication.CancelAllLocalNotifications();
But without any success... maybe I put them into the wrong place.
Thanks for hints and help
If I understand your question, the answer is it depends.
If you cannot change the push notification on the server, then no. The system will display it as soon as it arrives as it is formatted as the notification that needs to be displayed.
However, you can change the format of notification payload so that it doesn't display but it is rather processed by the application. Then you can process it in the app similar to what you do on Android.
I don't want to change the notification. I just don't want to show
it...
I don't think it is possible to choose which notification to show when your app is not running.
If your app isn't running then the notification is processed by iOS and your app doesn't get called.
You can have a look at answer in this thread.
Refer: https://learn.microsoft.com/en-us/xamarin/ios/platform/user-notifications/

Receiving messages back to my platform

Use Case SMS leaves my platform and goes out to a receiver (SMS). I would like to attach some sort of custom identifier so when the user responds back to the SMS..and my platform received the message..I know how to internally route the response back in my platform.
Any ideas?
Maybe set up a system where when the code is sent out
For instance:
Code - 11832
The user then has to enter this code on your website. A program will then match to see if it's the identical code. So you are then able to log the information
No expert on this though and Where is your code ?
Twilio evangelist here.
There isn't really a great way to attach an identifier to the message itself. You could force the user to prepend/append a code in their reply, but depending on your specific scenario that might not be a great user experience.
Another option is to save the to/from phone number as a unique pair when you send the message. Then as your application receives replies you can check the incoming to/from phone number against what you saved.
Hope that helps.

Sinch, presence info

Is there a way to get presence info of each sinch user (sinch sdk, user online/offline)?
for example, I would not want to make a voip call to somebody who is not online currently,
cause it takes too much time for Sinch to find out whether the call can be made or not.
Currently, it is not possible to query for a user's capabilities before placing a call. Instead, an error specifying the user has no call capability will be returned when calling that particular user.

Windows Phone 7 - Incoming Call Screen

Is there anyway when receiving a call to add data to the incoming call screen?
I'd like to be able to add text to that screen if possible.
Update:
If there is no way to currently add text to this screen is there a way to trigger code based off of an incoming phone call?
The only way you can do anything in relation to an incoming call is be informed that this has happened via the Obscured event.
Be aware that other things (such as an alarm) also trigger this event and there is no way within your app to know what caused your app to be obscured.

Windows Phone 7 - How to calculate call duration or termination

I'm new to windows phone 7 development...
Can anyone please tell me how to calculate call duration? or how to get notification of incoming call? using silverlight or c#
is there any API's available..
Thanks
Sam
There is no way to get calls information or notifications of incoming calls on the current Windows Phone 7 SDK.
There is no way to access call information.
However if your app is running and a call comes in the Obscured event will be triggered. You can then use a combination of the Unobscured, NavigatedTo, Loaded & Activated events to determine when the app has the focus again.
This won't give you the length of the call but rather then time between an event that may be a call (including incoming SMS, alarms, etc.) and the user returning fully to your app. This may be a good enough approximation, but it will depend on your needs.

Resources