The title pretty much says it all. A few days ago the FB.Feed was working normally. The user could hit the share button and simply post the pre made feed story to his timeline. Now there has to be some sort of user input involved in order for the story to get posted. Even if its just a white space. Has facebook changed something or what ?
here is the feed method :
if (FB.IsLoggedIn)
{
int shareScore = m_score.globalScore;
string shareMsg1 = "SAmple msg";
string shareMsg2 = "Sample msg2";
if (gameOverFlag)
{
shareScore = m_score.scoreForPost;
shareMsg1 = "game overmsg1";
shareMsg2 = "gameover msg2 ";
}
FB.Feed(
link: "test.com",
linkName: shareMsg1 + (DataHolder.holder.levelIndex + 1).ToString() + " FuBar",
linkDescription: "Some text",
linkCaption: shareMsg2 + shareScore + " and " + score.ToString() + " Stars",
picture: "test.com/test.jpg",
callback: LogCallback
);
}
else
{
FB.Login("public_profile,user_friends,email,publish_actions", LoginCallback);
}
I replaced the proper links with the fictional test.com in the given example.
I have a desktop application written in C#. I want to collect user statistics in google analytics. For instance I want to know when user pressed on specific button and what was value in text control when he did it.
I am sending events data as explained here. I tried to do this either with WebClient.UploadValues like in this question and also with WebClient.UploadString
I have set up new google analytics account. When I was asked what I want to track (website or mobile app) I have selected mobile app (there was no choice for desktop apps).
The problem is that I don't see any data in my Google Analytics account. I know it may take some time while new data will appear there but I have waited for 3 days. And also I don't see anything in real time view when I test my application ( I also have some websites with analytics connected and when I browse them I see new pageviews in realtime section).
What am I doing wrong?
Here is the code that I use:
private static string _googleURL = "http://www.google-analytics.com/collect";
private static string _gaid = "UA-12345678-9";
public static void TestMethod()
{
try
{
string data = "";
data += "v=" + HttpUtility.UrlEncode("1");
data += "&" + "tid" + "=" + HttpUtility.UrlEncode(_gaid);
data += "&" + "cid" + "=" + HttpUtility.UrlEncode(Guid.NewGuid().ToString());
data += "&" + "t" + "=" + HttpUtility.UrlEncode("event");
data += "&" + "ec" + "=" + HttpUtility.UrlEncode("testevent");
data += "&" + "ea" + "=" + HttpUtility.UrlEncode("testaction");
data += "&" + "el" + "=" + HttpUtility.UrlEncode("testlabel");
using (var client = new WebClient())
{
client.UploadString(_googleURL, "POST", data);
}
}
catch (Exception ex)
{
Trace.WriteLine(ex);
}
}
I have some toast notifications with alarm scenario. I used the following toast schema, but when notification is raised, there are no buttons(snooze or dismiss).
Here is my xml content. So why cant i use this toast commands?
var contentString = "<toast duration=\"long\">\n" +
"<visual>\n" +
"<binding template=\"ToastText02\">\n" +
"<text id=\"1\">" + alarmTitle + "</text>\n" +
"<text id=\"2\">" + alarmNote + "</text>\n" +
"</binding>\n" +
"</visual>\n" +
"<commands scenario=\"alarm\">\n" +
"<command id=\"snooze\"/>\n" +
"<command id=\"dismiss\"/>\n" +
"</commands>\n" +
"<audio src=\"ms-winsoundevent:Notification.Looping.Alarm2\"\n" +
"loop=\"true\"/>\n" +
"</toast>\n";
As is normal, Windows Phone 8 RT does not have the all features of Windows Store Apps.
There is a link on the MSDN that says what is not available on WinRT apps.
One of the entries is Alarms and reminders, so sadly you will not be able to use alarms on WP8.1.
Quick question.
I did this:
myChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(myChannel_ShellToastNotificationReceived);
So if I receive a toast notification while the application is in the foreground the myChannel_ShellToastNotificationReceived function should be called. In that function I have:
void myChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
{
Dispatcher.BeginInvoke(() =>
{
ApplicationTitle.Text = "Toast Notification Message Received";
});
}
The problem is that the function is never called and the ApplicationTitle is never changed.
Am I doing anything wrong?
I've found the problem...it seemed that the toast xml that was being sent was well enough formatted so the phone would receive it out of the app but not when it was inside it.
Wrote the xml by "hand" and didn't use xmlWriter and worked.
string toastMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1>" + title + "</wp:Text1>" +
"<wp:Text2>" + message + "</wp:Text2>" +
"</wp:Toast>" +
"</wp:Notification>";
We use ADP for employee information. I had to create a small app that called some web services that ADP has to pull employee information. The app is fairly procedural..not really object orientated in a sense. Basically I go through some web services to pull general information, work information, employee status, etc.
I have most of this data writing out to a text file as a log so I can ensure that everything is working correctly. Finally got it all done, and it works perfect on my local machine. Thought I'd just copy the entire structure onto a server and use windows scheduler to schedule the exe to run nightly (once a day). When it tries to run the app it looks like it is dying when it calls the first web service. The task scheduler log says:
""ADP.job" (ADP.exe)
Started 2/11/2010 2:14:34 PM
"ADP.job" (ADP.exe)
Finished 2/11/2010 2:14:38 PM
Result: The task completed with an exit code of (e0434f4d)."
So I checked the event viewer and it says this:
EventType clr20r3, P1 adp.exe, P2 1.0.0.0, P3 4b745bb9, P4 adp, P5 1.0.0.0, P6 4b745bb9, P7 289, P8 2d, P9 system.io.filenotfoundexception, P10 NIL.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
I put in some console.writelines to see where it is failing...
Here is a simple example of main:
static void Main(string[] args)
{
OpenTextFile();
Console.WriteLine("About to process employee work information...");
tw.WriteLine("About to process employee work information...");
//work info service
EmpWorkInfo();
}
And inside of opentextfile:
public static void OpenTextFile()
{
//used to log data
String sLogName;
Console.WriteLine("Inside of opentextfile");
if (Directory.Exists(logPath))
{
//directory exists
}
else
{
Directory.CreateDirectory(logPath);
}
Console.WriteLine("Inside of opentextfile2");
sLogName = "log_" + DateTime.Today.ToString("MM_dd_yyyy") + ".txt";
tw = new StreamWriter(logPath + sLogName);
}
I see all the console.writelines on the server but as soon as it hits this line from main:
EmpWorkInfo();
Thats when all hell breaks lose (basically it doesn't work). The EmpWorkInfo() is simply a function to get work related information from a web service (as I said this works locally).
static void EmpWorkInfo()
{
Console.Writeline("THIS NEVER PRINTS!!!");
SQLClass s=null;
// Create the web service proxy client.
GetEmployeeWorkInfoService oService = new GetEmployeeWorkInfoService();
oService.Timeout = Int32.MaxValue;
// Serialize the UsernameToken into XML.
// Create the UsernameToken as defined in the WS-I secure profile.
UsernameToken oUsernameToken = new UsernameToken(USERNAME, SECRET);
System.Xml.XmlElement oSecurityHeaderXml =
oUsernameToken.GetXml(new System.Xml.XmlDocument());
ADP.GetEmployeeWorkInfoWebService.SecurityHeaderType oSecurityHeader = new ADP.GetEmployeeWorkInfoWebService.SecurityHeaderType();
oSecurityHeader.Any = new System.Xml.XmlElement[] { oSecurityHeaderXml };
oService.Security = oSecurityHeader;
GetEmployeeWorkInfoRequestFilter oFilter = new GetEmployeeWorkInfoRequestFilter();
//filter by thyssenkrupp company
oFilter.Companies = new String[] { COMPANY_IDENTIFIER };
GetEmployeeWorkInfoRequest oRequest = new GetEmployeeWorkInfoRequest();
oRequest.Filter = oFilter;
try
{
EmployeeWorkInfoType[] arPersonalInfo = oService.GetEmployeeWorkInfo(oRequest);
try
{
s = new SQLClass();
}
catch (Exception e)
{
throw new System.Exception(e.Message.ToString());
}
for (int i = 0; i < arPersonalInfo.Length; i++)
{
String stID = arPersonalInfo[i].EmployeeKey.Identifier.EmployeeId; //employee number
String stEmailAddress = arPersonalInfo[i].WorkInfo.EmailAddress; //employee email address (work)
String stFax = arPersonalInfo[i].WorkInfo.Fax; //employee fax number
DateTime dtHireDate = arPersonalInfo[i].WorkInfo.OriginalHireDate;
String stPhone = arPersonalInfo[i].WorkInfo.Phone; //employee phone number
String stWireless = arPersonalInfo[i].WorkInfo.Wireless; //employee wireless number
tw.WriteLine("Processing ID:" + stID + " Email Work: " + stEmailAddress + " Fax Work: " + stFax + " Hire Date: " + dtHireDate + " Phone Work: " + stPhone + " Wireless Work: " + stWireless + ".");
Console.WriteLine("Processing ID:" + stID + " Email Work: " + stEmailAddress + " Fax Work: " + stFax + " Hire Date: " + dtHireDate + " Phone Work: " + stPhone + " Wireless Work: " + stWireless + ".");
s.SetSQLCommand("dbo.ADP_uiEmployeeWorkInfo");
s.AddSQLCmdParameter("#EmployeeNumber", System.Data.SqlDbType.VarChar, stID);
s.AddSQLCmdParameter("#EmailAddress", System.Data.SqlDbType.VarChar, stEmailAddress);
s.AddSQLCmdParameter("#Fax", System.Data.SqlDbType.VarChar, stFax);
s.AddSQLCmdParameter("#HireDate", System.Data.SqlDbType.DateTime, dtHireDate);
s.AddSQLCmdParameter("#Telephone", System.Data.SqlDbType.VarChar, stPhone);
s.AddSQLCmdParameter("#Mobile", System.Data.SqlDbType.VarChar, stWireless);
s.SQLExecuteNonQuery();
Console.WriteLine("Processed ID:" + stID + " Email Work: " + stEmailAddress + " Fax Work: " + stFax + " Hire Date: " + dtHireDate + " Phone Work: " + stPhone + " Wireless Work: " + stWireless + ".");
Console.WriteLine(Environment.NewLine);
}
s.CloseSQLDB();
s.Dispose();
}
//catch any exception from adp side.
catch (Exception e)
{
throw new System.Exception(e.Message.ToString());
}
}
This functions code is irrelevant (its ugly but do not let that bother you, the code works...). My issue is I cannot even get to the first console.writeline of that function. Is there anything special I need to do when it comes to working with webservices?
Edit
Logpath is defined as simply a static string outside of main:
private static string logPath = Environment.CurrentDirectory + "\\log\\";
I suspect that your application is not able to load the types referenced in that function - EmpWorkInfo.
1) Can you run this application on the target server in a commannd window (cmd.exe) ?
2) Are you using any assemblies from ADP that are installed in the global assembly cache (GAC)? Run "gacutil -l" on your localmachine to see if you are using any assemblies from ADP that are installed in thr gac. If they are, you will need to install these into the machine on which you are running the app.
Does logPath have a trailing backslash? Either way, you ought to use Path.Combine, rather than the string catenation operator (+).
What happens if you comment out all the code in EmpWorkInfo() apart from the first Console.Writeline? Does it still not get written out?
Found out I need the Microsoft.Web.Services3 dll installed on the server.
Continuation on "feroze" answer;
If you want to figure out if the 'loading of dependencies' is causing you grief here, i suggest using the "FUSLOGVW.EXE" tool *(part of .Net). When you run this it will give you a little dialog window with a few options. Create a directory somewhere (like "c:\temp\fusion_logs"), set the mode of FUSLOGVW to "log bind failures only", "custom location->c:\temp\fusion_logs".
Now restart your application and check that it failed. Now look into your fusion_logs directory. This should give you sub directories with different (maybe only 1 for now) application names. Inside each directory you will find the log files. These log files contain the "failed assembly loads" and who (which calling assembly) caused them.
They might help your hunt for a working application,
Hope this helps,
Edit: Posted this after you found the cause. The fuslogvw.exe would have shown you the missing assembly.