OpenTok SDK - Null reference error - Xamarin iOS - ios

I have built a simple Xamarin iOS app to subscribe (no publishing) to a single stream and display it in my primary view. The app will connect to a screen capturing stream from a desktop application that will be publishing the stream.
My Setup
Windows VS paired to a remote Mac, running a simulator on my local windows environment.
Using Xamarin.OpenTok.iOS (SDK v2.17.1) Nuget package in project.
My project is not a Xamarin Forms cross-platform application, but solely an iOS application.
OpenTok session and tokens generated in project management portal. I have attempted both "Relay" and "Routed" with the same results. I have been creating tokens with a 7 day expiration.
In developing the implementation of the OpenTok SDK into my app, I have followed the project found here
The Issue
I am creating a new session passing in my newly generated API Key and Session Id and then Connecting with my subscriber token.
_session = new OTSession(_apiKey, _sessionId, null);
...
_session.ConnectWithToken(_userToken, out error);
I am also subscribing to relevant Session events (ConnectionDestroyed, DidConnect, StreamCreated, StreamDestroyed, DidFailWithError).
After starting this connection I am given the following output and none of the events I am subscribed to are invoked.
Output Log - StackOverflow would not let me paste the log here
I am also seeing an attempted connection to the Session in the OpenTok Inspector.
Session Log
I am aware of this ticket and have confirmed it is not an expired token. I am pretty confident that this null reference is coming from the OpenTok SDK source code and not my code but cannot tell what it is. The error will completely freeze my app as the looping does not stop. Any help and guidance would be appreciated. So the questions are:
What is causing this error and how can I fix it? Am I missing an initialization step?
Is the iOS Simulator the real issue?
Thanks

a simple Xamarin iOS app to subscribe (no publishing) to a single
stream and display it in my primary view. The app will connect to a
screen capturing stream from a desktop application that will be
publishing the stream
This is possible to implement with Xamarin Vonage Video API SDK. I will try to explain that as detailed as possible, feel free to skip ahead.
You started correctly with the Xamarin samples.
In fact, there are only 2 changes you need to do to achieve your goal with Xamarin.iOS app (not Xamarin.Forms, will get to that later):
Update ApiKey, SessionId and Token in OpentokTestConstants.cs (here) file
Comment out Publish() in the OpentokStreamingService so that the app only subscribes to video streams in the session and does not publish camera stream
Here is a screenshot running the sample app with these changes in iOS simulator and viewing a stream published from the web (I used the "The OpenTok Playground" tool for that)
Now, regarding Xamarin.Forms.
There is no sample for Xamarin.Forms, unfortunately. If you can share a sample app (without ApiKey/SessionId please) I'd be glad to look at it.
Generally, a logic for video calls on Xamarin.Forms is:
have DependencyInjection wiring to expose key methods from OpentokStreamingService that is implemented in iOS/Android samples (docs on how you do that in Xamarin.Forms)
implement a custom Xamarin.Forms view + renderers for it. The view does not need to do anything. The renderer should be doing at least one thing - passing down a reference to a native view to the OpentokStreamingService using a code like this:
_opentokService.SetStreamContainer(NativeView, false);
where NativeView is a native (Xamarin.iOS/Xamarin.Android) view (not Xamarin.Forms view). You can get that reference in the renderer's ElementChanged method.
This doc from Xamarin covers that well.
After the selected line, Control will have a native view reference that you just need to pass to OpentokStreamingService.
That will get you a scenario working in Xamarin.Forms. I hope that this answer helps!
P.S.: Logging with Vonage Video API Xamarin SDK on iOS
There is a better way to get logs for diagnostics purposes with iOS SDK.
A call like that before any OpenTok SDK calls would give you a very detailed log of what's going on:
OpenTok.OpenTokExtraLogging.EnableOpenTokLoggingToConsole();
It will look like this:

Related

How do I access my azure database data from my xamarin mobile app?

I'm new to mobile app development, I've been tasked with making an app and so I'm now starting my voyage of discovery. I am coding the app in Visual Studio 2015 with Xamarin using a Mac Book Pro as the client for testing, all our data is stored in a database in our Azure portal. The app I am making is for iOS.
I've read the documentation but I'm getting stuck in certain areas and I think it's down to not understanding what is needed based on conflicting documentation or my own failure to grasp the concepts outlined.
All I am looking to do at the moment is have my app grab data from my azure database and display it in a list/table.
The steps I have taken so far are:
I have created a very basic app within visual studio with a
storyboard and a navigation item that points to a table view(where I'd like my data to be shown).
I created a Mobile App in my Azure account(as per documentation).
I have set the above mentioned mobile app to use my current existing database and supplied it with the username and password which all seems to be ok.
I am now at the point I need to get my app to talk to this mobile app and grab some data from my database. The todo example is ok but it's not quite enough to get me up and running or more specifically it's not in quite the right context for my setup and I think it's causing confusion.
There seems to be a few ways to set the project up for data access but I'm not sure what would be best.
Can anyone assist?
You are nearly there.
Instead of connecting directly to your database, you connect to your mobile apps API which then connects to your database, handles your request, and sends the data back to your app. You need to code this backend first so it is able to handle your requests. Take a look at this tutorial, it is really good :
https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-dotnet-backend-how-to-use-server-sdk
You will access your Azure Mobile App with the Azure Mobile Client SDK nuget package.
A complete guide to do this can be found here: https://developer.xamarin.com/guides/xamarin-forms/web-services/consuming/azure/
There is also this podcast: https://blog.xamarin.com/podcast-building-connected-apps-with-azure-mobile-apps/

Razer Nabu iOS Authorisation

I'm trying to setup a test iOS app to see what I can do with the Razer Nabu but I'm struggling with the patchy documentation. The example for authentication only mentions a 'fitness' scope and with that I don't seem to be able to send a notification to the band (the main thing I'd like to try).
When I try and send a notification I get Operation 36 returned and no notification on the band so I assume that means it failed (return codes from the SDK aren't documented it seems).
Does anyone know if there is a different scope for notifications? I tried 'notification' and 'notifications' but they resulted in failure to authorise in the Nabu Utility app.
Any help or pointers to documentation/samples/guides I might have missed would be very helpful!
NB I managed to get authorised with the 'fitness' scope and read some fitness data so everything's working except for the notifications!
Having got in touch with the Razer support guys and talking to this lovely chap called Brandon the issue was that I had the Nabu Utility app from the App Store and the version from the developer site was actually more up to date in this respect, so getting that one installed (and uninstalling the App Store version) made everything work correctly!

Access code and data in hosting app using today extension

I'm wondering if it's at all possible to access features in the main app using a today extension in iOS 8. For example, can a media player send commands from its extension to the main app without opening the app (I know there is a framework for this but it's just an example)? The only solution I can see is using URIs but the problem is that it will open the app which isn't the behavior I'm looking for.
So for a complete example using the media player:
There is an extension in the today screen that allows you to play/pause using a button.
The user presses the button and the app plays/pauses in the background without leaving the notification center.
Any way to achieve this behavior?
Code can be shared using an embedded framework, however there are some backwards compatibility issues.
Data can be shared using shared user defaults.
Both are explained in the apple docs.

iOS Conversion / installation Tracking

Objective: i want to fetch my custom parameter(referrer) from iTunes link upon installation of my application in device.
iTunes links look somethings like this:
https://itunes.apple.com/in/app/complete-gym-guide-lite/id550449574?mt=8
If i append my parameter say(&referrer=xyz)at the end and i open this url in ios safari browser then it will prompt to download the application.
Confusion: will app store send my parameter(referrer) to my application on launch so that i can fetch it in my application and use it.
In case of Android play store link look like this: http://play.google.com/store/apps/details?id=&referrer=guid%3D%guid%
As you can see referrer parameter at the end of url. Once app is installed in device then play store will send this parameter to app using INSTALL_REFERRER broadcast receiver. We can use this parameter.
What i tried OR Other people doing for conversion tracking: Other people are simply sending static data to their server at the first time opening of app and maintain a flag in NSDefault to make sure that app does not send same data again. I can also do the same as well as alternate ways suggested in below links but i want to do something with custom parameter.
I have already seen below links:
iOS - track which ad campaigns my installs are coming from
Tracking iOS installs from multiple marketing sources
Please help me out.
As #Aditya said, for now, Apple is not sending any referrer (or params) from iTunes to installation.
The only way you have it's to use a third party sdk to get your installations.
I have been working on a own sdk to get this but the way to get any info it's really hard and not really confident to use it. So endly we used some third party which are using many techniques to getting this (as fingerprint data, App2App methods, etc...)
I have tested appsflyer sdk and facebook sdk, they work as expected, use this or any else you prefer.
Hope this helps

AIR for iOS and Google analytics

There seems to be conflicting information on whether google analytics will work with an AIR for iOS application
Have developed a kiosk based AIR for iOS game and need tracking, specifically image uploads to Facebook.
There is a thread here
Does Google Analytics Tracking for Flash works in packaged air application for IOS?
which points to both the old gaforflash sec
http://code.google.com/p/gaforflash/downloads/list
and also this native extension
https://github.com/alebianco/ANE-Google-Analytics
which is a lot more recent.
But there is a warning on the latter
'The new "app" profile on the Google Analytics dashboard won't accept any data from the trackers (1.5 and 1.5.1) currently used.'
Also there is a warning on the official Google developers page which I also assume hasn't been updated in many years
Note: Currently, Flash tracking is available for any Flash content embedded in a web page. Tracking of data sent from Adobe Air, Shockwave, or via the Flash IDE (e.g. using Test Movie) is not supported at this time.
https://developers.google.com/analytics/devguides/collection/other/flashTrackingIntro
So some confusion. Can anyone confirm whether the alebianco Native Extension will work properly?
My extension (https://github.com/alebianco/ANE-Google-Analytics) has been updated a few months ago, it now supports the new app profiles gracefully :)
Any info on whether the old GAForFlash component still works? I've been trying and so far, no dice.
I copied analytics_flash.swc to Flash CS6's components folder(and restarted the Flash IDE - it doesn't work if you don't restart), which got the GAFF component to show in the component panel. I've tried dragging the component on the stage, setting it's values in the properties panel, and then calling trackPageview:
testTracker.trackPageview("/testPage");
And the second thing I've tried so far is to instantiate the analytics plugin via code:
var GAtracker:AnalyticsTracker = new GATracker(this, GAid, "AS3", true);
GAtracker.trackPageview("/myTestPage");
In both these cases, I'd had visual-debugging turned on(by passing the 4th variable as true when instantiating via code, and via the property panel otherwise). And in the visual-debugger everything seemed alright, and I got "Gif Request #x sent" after each analytics call. But nothing showed in Google Analytics' online portal. While setting up analytics, I'd selected that the app was a "mobile app" rather than a "web-page", and it'd given me links to GA's droid/iOS SDK. GAForFlash's official documentation says it may not work with AIR apps, as mentioned above. But when I published it with an HTML wrapper Not sure if the problem is with my implementation, or with GAForFlash...

Resources