I use Azure Mobile Services notification in my app.
If my app is already launched, I have to get the id of the new product (by the notification) and do some treatments.
I followed this tutorial : http://msdn.microsoft.com/en-us/library/windows/apps/jj709907.aspx
The problem is : how get id of this new product by accessing notificationContent ?
I try some things :
Azure side, on JS :
push.wns.sendToastText04(channel.currentkey, {
text1: "New product added : " + item.name,
param1: item.id});
or
push.wns.sendToastText04(channel.currentkey, {
text1: "New product added : " + item.name,
param: item.id});
or
push.wns.sendToastText04(channel.currentkey, {
text1: "New product added : " + item.name,
launch: item.id});
but can't get the id in notificationContent.
Here is the answer :
http://social.msdn.microsoft.com/Forums/windowsazure/en-US/828e84fc-8441-4aa4-b33e-4f73bdcf1488/opening-a-page-when-user-clicks-on-a-toast-notification
Hope it can help people later !
Related
So we are working to implement Enhanced ECommerce tracking for a client. We have done this with a dataLayer push. The web developer has implemented our code as suggested but there have been instances when the dataLayer.push is missed for a few transactions.
I have attached the code below for how it is currently implemented on the Order success page.
There could be some issue with AngularJS implemented on the website and would be grateful if someone can help me to understand how I should implement the GTM code for those missed page views and dataLayer.push codes.
When I am viewing in GTM debug window, there are two instances that happen;
The purchase event will trigger in the dataLayer.push and we get the transaction data in Google Analytics.
The page-view will trigger and no dataLayer.push event will follow. Even though when I check the page source the dataLayer.push codes are available for purchase.
function getCartproducts() {
var dataLayerIndex = new Array();
dataLayerIndex.push({"name": "xxxxxx" , "id" : "xxxxxx" , "price" : "11.00" , "category" : "xxxxx" , "quantity" : 2});
return (JSON.stringify(dataLayerIndex));
}
function getCoupon(){
var couponLayerIndex = new Array();
couponLayerIndex.push('');
return (JSON.stringify(couponLayerIndex[0]));
}
window.dataLayer.push({
'event': 'checkout',
'ecommerce': {
'checkout': {
'actionField': { 'step': 5 },
'products':
JSON.parse(getCartproducts())
}
},
})
window.dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'actionField': {
'id': '269459',
'revenue': 25.65,
'tax': '3.85',
'shipping':'7.50',
'coupon': getCoupon(),
},
'products': JSON.parse(getCartproducts())
}
}
});
I expect the code to trigger a custom purchase event every time the final thank you page is viewed by a user. But as described, we miss quite a number of transactions.
I want to set the createdDate for a new feed-element (via SalesForce Rest API).
I tried to do this:
{
"body" : {
"messageSegments" : [
{
"type" : "Text",
"text" : "When should we meet for release planning? "
}]
},
"feedElementType" : "FeedItem",
"subjectId" : "0060Y00000XYZXYZ",
"createdDate ": "2016-10-27T08:01:56.000Z"
}
But I get this error message:
[
{
"errorCode": "JSON_PARSER_ERROR",
"message": "Unrecognized field \"createdDate \" at [line:-1, column:-1]"
}
]
I read that I can set the createdDate via API (https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_feed_element.htm), but I don't find a example or a way to do this.
Also I tried to set the createdDate in a update request, but the same result.
I hope someone can help me. Thanks!
I'm trying to use the paypal-cordova-plugin to integrate paiement on my mobile app. But the instructions I am following are asking for sandbox id and production id but I have no idea where to find them in paypal. Can someone help me on this ?
This is the place where they are asked
angular.module('app')
.constant("shopSettings", (function () {
return {
payPalSandboxId: "Aar8HZzvc5NztVWodTBpOiOod9wWrBDrJUjyvRr4WsxcCD28xYig7oecfYsqxQUDu5QHptPpSALirxZD",
payPalProductionId : "production id here",
payPalEnv: "PayPalEnvironmentSandbo", // for testing production for production
payPalShopName : "SenPass",
payPalMerchantPrivacyPolicyURL : "url to policy",
payPalMerchantUserAgreementURL : "url to user agreement"
}
})());
This is the link I'm following : http://ionicandroidlearning.blogspot.fr/2015/11/ionic-paypal-integration.html
First you need to create an account on paypal developers.
Then inside the dashboard create a new application (REST API apps).
When you create the new app, Paypal will generate a sandbox account and a client id for you.
Add the code (example):
var configuration=function () {
var configOptions = {
merchantName: "Some name you have specified",
merchantPrivacyPolicyURL: "http://yourserver/privacypolicy",
merchantUserAgreementURL: "http://yourserver/agreement",
languageOrLocale: "en_US"
};
// for more options see paypal-mobile-js-helper.js
var _config = new PayPalConfiguration( configOptions );
return _config;
}
var onPrepareRender = function(){
$log.info(" ======= onPrepareRender ==========");
}
var onPayPalMobileInit = function(){
var payPalConfig = configuration();
PayPalMobile.prepareToRender("PayPalEnvironmentSandbox", payPalConfig, onPrepareRender);
deferred.resolve( payPalConfig );
}
var clientIDs = {
"PayPalEnvironmentProduction": '', //leave it blank
"PayPalEnvironmentSandbox": 'your sandbox id'
};
PayPalMobile.init(clientIDs, onPayPalMobileInit);
to retrive PayPal Sandobx keys try to go here:
https://developer.paypal.com/developer/accounts/
click on your generated account for testing (in the table) and then on Profile ...it open a modal with some tabs .. choose the API Credential tab
Hope it can help you
I have used satellizer and node server for login in my website with google sing in.
I have successfully login and following data added in mongodb database.
{
"_id" : ObjectId("57adec45a8fb51401c1ba843"),
"displayName" : "xyz user",
"picture" : "https://lh3.googleusercontent.com/-xxxxxxx_xx/xxxxxx/xxxxxxx/xxxxxxx/photo.jpg?sz=200",
"google" : "100379763204xxxxxxxxx", //user id
"__v" : 0
}
Now, I want to get other information from google account like Gender, Phone Number, Location etc...
So, How to get all information of login user from google account?
Not all of that information is actually available. It will also depend upon if the user has set the information to public or not.
If you use the People: get method it will return a person resource Resource. Assuming the user has this information public you should see the information you are after. This method is part of the Google+ api so it will only work if the user has a Google+ account.
There is also the People API which tends to return similar information people.get. I am not sure exactly were this information is coming from. It appears to be related to a users Google account as opposed to the Google+ account.
I finally success , there is my solution :
getGoogleDatas: function (id) {
return $http.get("https://www.googleapis.com/oauth2/v1/userinfo", {
params: {
access_token: $auth.getToken(),
alt: 'json'
}
});
}
and then :
getGoogleDatas().then(function (response) {
user = response;
}).catch(function (error) {
console.log('error:', error);
});
My app creates a contact item that is used to communicate images to the application via a timeline subscription.
When I am deleting contacts via the REST API I am getting a success status and when I list the contact items via the REST API I can verify that the contact is removed.
But on the device itself the contact is still there. Only when I shutdown and startup the device the contact is gone. How can I make that happen immediately after my request?
My Device info: XE9 up to date. The device has a connection and I can update/delete timeline items without any problem.
Deletion of contacts can happen by your Glassware only if those contacts were inserted into your Glass by the same Glassware.
I have tried this DeleteAllContacts code, that works pretty well.
NewUserBootstrapper.deleteAllContacts(MirrorClient.getMirror(credential), credential);
and this is the method.
private static void deleteAllContacts(Mirror service, Credential credential)
{
try {
ContactsListResponse contacts = service.contacts().list().execute();
for (Contact contact : contacts.getItems())
{
LOG.info("Contact ID: " + contact.getId());
LOG.info(" > displayName: " + contact.getDisplayName());
if (contact.getImageUrls() != null) {
for (String imageUrl : contact.getImageUrls()) {
LOG.info(" > imageUrl: " + imageUrl);
}
}
MirrorClient.deleteContact(credential, contact.getId());
}
}catch (IOException ioe) {
LOG.warning("An error occurred: " + ioe.getMessage());
}
}