Firebase dynamic link custom params - firebase

'm having trouble with the final steps implementing firebase to our unity app, any help would be really really appreciated
The problem involves receiving custom parameters when the app is opened by a dynamic link
The app opens fine, redirects to store etc if needed so that's ok but when I try to use the custom parameter it never holds the desired info but instead returns the fallback url to our website, I'm using the on link received function copied from dynamic link test app.
the outgoing link looks like this - "https://fbb.page.link/PL/?p=XXXXXXXXXX; where XXXXX is the param im looking for
void Start() {
DynamicLinks.DynamicLinkReceived += OnDynamicLink;
}
void OnDynamicLink(object sender, EventArgs args) {
var dynamicLinkEventArgs = args as ReceivedDynamicLinkEventArgs;
Debug.LogFormat("Received dynamic link {0}",
dynamicLinkEventArgs.ReceivedDynamicLink.Url.OriginalString);
}
// Display the dynamic link received by the application.
void OnDynamicLink(object sender, EventArgs args) {
var dynamicLinkEventArgs = args as ReceivedDynamicLinkEventArgs;
Debug.LogFormat("Received dynamic link {0}",
dynamicLinkEventArgs.ReceivedDynamicLink.Url.OriginalString);
}
but the recieved link returns our homepage and not 'p'
Again any help much appreciated

I finally found the reason this wasnt working for me so for anyone searching as this has been troubling us for some time.
In the end it was because I was using a shortened link which was occluding the parameters I needed, once I tried using the original long link it worked straight away
So for cleanliness sake, I use a link to our website plus the required param, the site takes the param and inserts it into a preset long dynamic link url and redirects to that link, this gives us a nice tidy url with the benefits of parameters

Related

Adding an Event for Espresso on Wordpress from C#

Working with WordPress and the Espresso Plugin for Events. I've never dealt with WP or Plugin's before, so I'm in new territory.
I am attempting to add an event and I keep getting the following error:
{"code":"rest_cannot_create_events","message":"Sorry, you are not allowed to create events. Missing permissions: ee_edit_events,ee_edit_others_events,ee_edit_private_events","data":{"status":403}}
I've gone into the WP admin pages and made sure the user I am trying to login as has all the permissions for this plugin.
The first thing I do is access the /wp-login.php page to get the Cookies:
string formVars = "";
string result = "";
string eventUrl = $"<url>/wp-login.php";
Dictionary<string, string> headers = new Dictionary<string, string>();
formVars = $"log={UserName}&pwd={Password}";
Cookie = new System.Net.CookieContainer();
AllowAutoRedirect = false;
result = PerformPost(eventUrl, formVars, true, headers);
The PerformPost uses an HttpWebRequest to send and receive.
That part seems to work and I get what looks like valid cookies.
I then do another post to /wp-json/ee/v4.8.29/events/ and pass in the body just the name of the event like EVT_name=TestEvent.
It's at this point that I get the the error mentioned above.
So a couple of questions.
1) Has anyone done this before? (Added an Event to Espresso on WordPress)
2) If Espresso doesn't like what I am feeding it, does it generate this error rather than just telling me I'm not giving it the correct information?
I've also tried using the Basic Auth plugin with the same results.
Any help is greatly appreciated.

Understanding the JIT; slow website

First off, this question has been covered a few times (I've done my research), and, for example, on the right side of the SO webpage is a list of related items... I have been through them all (or as many as I could find).
When I publish my pre-compiled .NET web application, it is very slow to load the first time.
I've read up on this, it's the JIT which I understand (sort of).
The problem is, after the home page loads (up to 20 seconds), many other pages load very fast.
However, it would appear that the only reason they load is because the resources have been loaded (or that they share the same compiled dlls). However, some pages still take a long time.
This indicates that maybe the JIT needs to compile different pages in different ways? If so, and using a contact form as an example (where the Thank You page needs to be compiled by the JIT and first time is slow), the user may hit the send button multiple times whilst waiting for the page to be shown.
After I load all these pages which use different models or different shared HTML content, the site loads quickly as expected. I assume this issue is a common problem?
Please note, I'm using .NET 4.0 but, there is no database, XML files etc. The only IO is if an email doesn't send and it writes the error to a log.
So, assuming my understanding is correct, what is the approach to not have to manually go through the website and load every page?
If the above is a little too broad, then can this be resolved in the settings/configuration in Visual Studio (2012) or the web.config file (excluding adding compilation debug=false)?
In this case, there are 2 problems
As per rene's comments, review this http://msdn.microsoft.com/en-us/library/ms972959.aspx... The helpful part was to add the following code to the global.asax file
const string sourceName = ".NET Runtime";
const string serverName = ".";
const string logName = "Application";
const string uriFormat = "\r\n\r\nURI: {0}\r\n\r\n";
const string exceptionFormat = "{0}: \"{1}\"\r\n{2}\r\n\r\n";
void Application_Error(Object sender, EventArgs ea) {
StringBuilder message = new StringBuilder();
if (Request != null) {
message.AppendFormat(uriFormat, Request.Path);
}
if (Server != null) {
Exception e;
for (e = Server.GetLastError(); e != null; e = e.InnerException) {
message.AppendFormat(exceptionFormat,
e.GetType().Name,
e.Message,
e.StackTrace);
}
}
if (!EventLog.SourceExists(sourceName)) {
EventLog.CreateEventSource(sourceName, logName);
}
EventLog Log = new EventLog(logName, serverName, sourceName);
Log.WriteEntry(message.ToString(), EventLogEntryType.Error);
//Server.ClearError(); // uncomment this to cancel the error
}
The server was maxing out during sending of the email! My code was fine, but, viewing Task Scheduler showed it was hitting 100% memory...
The solution was to monitor the errors shown by point 1 and fix it. Then, find out why the server was being throttled when sending an email!

Struts2 upload file by POSTing

So I'm trying to integrate wami-recorder into my webapp. The webapp currently is built using the Struts2 framework.
There is an example on StackOverflow here on how to integrate wami-recorder into a php site. How would I achieve similar functionality using Struts2? It seems like wami tries to POST the file to a certain URL. How do I get Struts2 to receive such a file? Or is there a better way to go about this?
EDIT: MMk so, I used Dave's wording to search google and found this. Right now, my action's execute method looks like
HttpServletRequest request = ServletActionContext.getRequest();
InputStream body = null;
try {
body = request.getInputStream();
OutputStream outputStream = new FileOutputStream("/home/test.mp3");
IOUtils.copy(body, outputStream);
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return SUCCESS;'
However, when I use wami to POST
Wami.startRecording("http://localhost:8080/addRecording/test.wav");
I get the following in chrome developer tools:
Request URL:http://localhost:8080/addRecording/test.wav
Request Method:POST
Status Code:404 Not Found
Is there something wrong with the configuration of my action class? Or am I misusing wami?
Turns out with the updated code the file is actually being stored. Getting a 404 for other reasons. In any case, my question is answered.

Creating goal funnel for account sign up using javascript

I have a website which has got 4 steps for account sign up. I am trying to implement a google analytics funnel using javascript to find out how many people are gone through each step of sign up process.
I used asp.net wizard control for account sign up.Each step refers the same page(signup/default.aspx) with next and previous buttons.
protected void wzsignup_ActiveStepChanged(object sender, EventArgs e)
{
string step = wzsignup.ActiveStep.ID.ToString(CultureInfo.InvariantCulture); //example of step name is personaldetails..
string script = "var _gaq=_gaq || [];_gaq.push(['_setAccount','UA-XXXXX-1' ]);_gaq.push(['_setDomainName', 'none']);_gaq.push(['_trackPageview'],'/{0}');(function(){{var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);}})();";
script = string.Format(script, step);
HtmlGenericControl scriptTag = new HtmlGenericControl("script");
scriptTag.Attributes.Add("type", "text/javascript");
scriptTag.InnerHtml = script;
this.Page.Header.Controls.Add(scriptTag);
}
How do i get the report for signup steps?
The documentation google has on this is pretty good. There are two pieces that you will need to do. The first is to set up page view tracking by specifying a virtual url for each of the steps of your conversion funnel. Here's the documentation link for that:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=1116091#identical
The second part is setting up the goal within google analytics where you can create the goal and specify the steps for the funnel:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=1116091#funnels
I highly recommend that you read the google documentation on this... they outline these steps pretty well.

Silverlight MediaElement refusing to play audio

I am having the hardest time figuring this problem out. I have a Silverlight 4 application that loads audio and video files from URLs. The URLs are the same domain as the application is hosted on and it works great for video.
The URLs are actually asp.net mvc controllers that are responsible for reading the file from a shared location on and the server and serving back a filestream. The URLs look something like this:
http://localhost:31479/CourseMedia?path=\omnisandbox1\ILMSShare2\Demo-Fire+Behavior\media\Disclaim.wma&encrypted=False&id=00000000-0000-0000-0000-000000000000
If I put the URL directly into the browser the file loads and plays in windows media player just fine, and if I use a separate test silverlight project to load the url it also works, but for the life of me I can not get it to work properly in my main project.
This is the routine I use to actually do the source setting:
protected void SetPlayerURL(MediaElement player, string url)
{
if (player != null && url.Length > 0)
{
player.ClearValue(MediaElement.SourceProperty);
player.Source = new Uri(this.Packet.GetMediaUrl(url, false, Guid.Empty));
}
}
and the GetMediaURL function simply builds the URL format seen above:
public string GetMediaUrl(
string path,
bool encrypted,
Guid key)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat("http://{0}/CourseMedia?path={1}&encrypted={2}&id={3}",
this.Host,
System.Windows.Browser.HttpUtility.UrlEncode(path),
encrypted,
key);
return builder.ToString();
}
The request to the controller is never made for the media when it is audio. Seems odd to me as this exact code works fine for video. The MediaElement state never leaves "Closed" and the CurrentStateChanged,, MediaOpened, and MediaFailed events are never triggered.
I am at a loss!
Try setting ScrubbingEnabled of the MediaElement to false, there were some problems with Framework version 3.5 and audio and the workaround was setting that to false. Might be worth trying.
Also try capturing BufferingStarted, BufferingEnded, MediaEnded along with your MediaFailed and MediaOpened events. I'm curious if it is a buffering issue.

Resources