NFC Tag not working on Gear S2 - tizen-wearable-sdk

Im trying to read the data in NFC tag using web development. I am able to detect tags from emulator, but on Gear S2 it does not work.
I have given all the privileges in config.xml
<tizen:privilege name="http://tizen.org/privilege/nfc.common"/>
<tizen:privilege name="http://tizen.org/privilege/nfc.tag"/>
<tizen:privilege name="http://tizen.org/privilege/bluetooth.admin"/>
<tizen:privilege name="http://tizen.org/privilege/nfc.admin"/>
<tizen:privilege name="http://tizen.org/privilege/nfc.cardemulation"/>
I am using whiztags NFC tags with Gear S2, they are working with my mobile(Nexus 5).
I have switched on the NFC in my watch, but still they don't respond to tags.
Code:
var adapter = tizen.nfc.getDefaultAdapter();
adapter.setPowered(
true, // Enable NFC adapter
function () {console.log('Power on success');}, // Handle succes
function () {console.log('Power on failed');}); // Handle failure
//
var onSuccessCB = {onattach : function(nfcTag) {
console.log("NFC Tag's type is " + nfcTag.type);
navigator.vibrate([600, 100, 300, 200, 0]);
for(var i in nfcTag.properties) {
console.log("key:" + i + " value:" + nfcTag.properties[i]);
}
}, ondetach : function() {
console.log("NFC Tag is detached");
}};
adapter.setTagListener(onSuccessCB);

The NFC API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The NFC API is supported on the Tizen wearable Emulator, but not on the Tizen mobile Emulator.
Please go through this link for more details.
I've seen some other people having same issue. Have a look on this link too.

Related

Is there rich card support for Cisco spark (now Webex teams) Bot

I am implementing a cisco spark bot , which is now known as Webex teams. I am able to send receive simple text message from user. Is there a way to send rich card to user from Bot? I could not find any helpful documentation.
Here is my code I use to interact with bot
var SparkBot = require("node-sparkbot");
var SparkAPIWrapper = require("node-sparkclient");
// Starts your Webhook with default configuration where the SPARK API access
token is read from the SPARK_TOKEN env variable
var bot = new SparkBot();
var spark = new SparkAPIWrapper(process.env.SPARK_TOKEN);
bot.onMessage(function (trigger, message) {
if (message.personEmail != "mytestbot#webex.bot")
spark.createMessage(message.roomId, "You said " + message.text, {
"markdown":
true }, function (err, message) {
if (err) {
console.log("WARNING: could not post message to room: " +
message.roomId);
return;
}
});
});
Rich cards may contain buttons , links, list , thumbnail etc..
This is not supported yet on the platform side. The best you have at the moment is you can use markdown to style messages.

Xamarin Local Notification custom sound not playing

Currently working on implementing local notifications in my app and so far it's working exactly as intended but when attempting to replace the default sound with my sound file I no longer get any sound when the notification triggers and I cannot figure out why.
The code for the local notification:
public void GetLocalNotification(string message)
{
Android.Net.Uri sound = Android.Net.Uri.Parse("android.resource://" + Application.Context.PackageName + "/" + Resource.Raw.alarm);
// Build the notification:
NotificationCompat.Builder builder = new NotificationCompat.Builder(Application.Context)
.SetAutoCancel(true) // Dismiss from the notif. area when clicked
.SetContentTitle("Notification") // Set its title
.SetSmallIcon(Resource.Drawable.icon) // Display this icon
.SetDefaults(1 | 2) //Sets sound and vibration
.SetSound(sound)
.SetContentText(String.Format(
message)); // The message to display.
// Finally, publish the notification:
NotificationManager notificationManager =
(NotificationManager)Application.Context.GetSystemService(Context.NotificationService);
notificationManager.Notify(ButtonClickNotificationId, builder.Build());
}
Try setting this line: .SetDefaults(1 | 2) //Sets sound and vibration to .SetDefaults(0), which should stand for 'all'.
I've seen cases where this only plays sound when you set it to 0. I which I could say why, I have no clue to be honest, but it works.
#Gerald Versluis: thanks, but noticed that .SetDefaults(0) adds sounds but then also removes vibration. So to add on this questions, do.SetDefaults(0 | 2), with 2 being (int)NotificationDefaults.Vibrate.
Thus, my solution to add sound and vibrate is:
.SetDefaults(0 | (int)NotificationDefaults.Vibrate)

Port Admob to mobile web

I am in the depths of creating a mobile web game that I will soon release. I am interested in monetizing this app. I want the game to feel like its a regular app and therefore wish to have admob ads (with deep links to the app store). I have heard that these also have substantially higher cpm that adsense mobile. My question is this: if I "port" admob using node.js will the clicks and views be recorded as server side, i.e. coming from one place, or mobile, i.e. from the user?
Here are some resources I am thinking of using:
https://media.admob.com/api/v1/docs/
https://github.com/floatinghotpot/cordova-plugin-admob
Any thoughts?
I am the author of the plugin you mentioned: https://github.com/floatinghotpot/cordova-plugin-admob
The basic version has been deprecated, and the pro version is recommended: https://github.com/floatinghotpot/cordova-admob-pro
Instead of porting AdMob to mobile web, you can consider use Cordova to pack your html5 game as a hybrid APP, then publish to Apple AppStore or Google Play Store.
Use the AdMob plugin to present Ad in your app, then Google will pay you.
Only a few javascript lines to present the Ad, and the AdMob SDK will take care of Ad presenting and user click.
See the example code:
function onLoad() {
if(( /(ipad|iphone|ipod|android|windows phone)/i.test(navigator.userAgent) )) {
document.addEventListener('deviceready', initApp, false);
} else {
initApp();
}
}
var admobid = {};
if( /(android)/i.test(navigator.userAgent) ) {
admobid = { // for Android
banner: 'ca-app-pub-6869992474017983/9375997553',
interstitial: 'ca-app-pub-6869992474017983/1657046752'
};
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
admobid = { // for iOS
banner: 'ca-app-pub-6869992474017983/4806197152',
interstitial: 'ca-app-pub-6869992474017983/7563979554'
};
} else {
admobid = { // for Windows Phone
banner: 'ca-app-pub-6869992474017983/8878394753',
interstitial: 'ca-app-pub-6869992474017983/1355127956'
};
}
// it will display smart banner at top center, using the default options
if(AdMob) AdMob.createBanner( {
adId: admobid.banner,
position: AdMob.AD_POSITION.TOP_CENTER,
autoShow: true } );

New websocket on different instance of site

I have a remote control for 4 Devices running on a node server.
Each device has its own page (/1, /2, /3, /4), but they are all generated from the same html/js.
the only difference is the ip for each device, loaded from a json on the server depending on the url path.
This all works, but the problem is: i have 3 obviously wrong IPs entered for testing purposes, and one correct one. Now if i open the correct one, go back to the parent page and open the page of a device with a wrong IP, it is still shown as online and can be controlled.
I understand this like: the socket stays open across the pages and is actually not built new on every site.
how can i make sure that each subpage generates a new socket?
right now, i just have
socket = new io.connect();
in the browser.js,
ioServer.on('connection', function (socket) {
//etc.
}
in the app.js and it works for ONE device.
Am I right to assume that I need some kind of "destroy socket if page is changed"-function?
Thanks for the help
By the looks of it, you only want to instantiate and boot a device when the device's client connects for the first time and emits 'startup'. If this is not the case, I'd probably instantiate and boot each device when the server starts.
Going with the first case, I'd store your devices in a key-value object and reuse them when needed.
var devices = {};
ioServer.on('connection', function (socket) {
var client_ip_address = socket.request.connection.remoteAddress;
console.log("New Connection from: " + client_ip_address);
var device;
socket.on('startup', function (data) {
var deviceId = data.device;
console.log("[INFO] startup: device " + deviceId);
//If this device is already in devices, resuse it
if (deviceId in devices) {
//Get the device from your devices object
device = devices[deviceId];
//Otherwise, create a new device and store it in devices
} else {
device = new HyperDeck(deviceId);
//Store new device in devices object
devices[deviceId] = device;
device.boot();
}
console.log(device.id);
console.log(device.ip);
});
...

Notification Hub with localized messages

i just came up with a new problem but the same context azure. now i am trying to implement Multilinqual(localized) push notifications so i am following this localized push notification so this link inculde lot of work of making categories i just wanted to omit them so i am trying to use direct code for subscribing the toast notification on the basis of tag given in Bachend clien app that generate toast notification...here is Backend client app code..
NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString("Endpoint=sb://samplenotificationhub-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=", "samplenotificationhub");
var notification = new Dictionary<string, string>() {
{"News_English", "World News in English!"},
{"News_French", "World News in French!"},
{"News_Mandarin", "World News in Mandarin!"}};
await hub.SendTemplateNotificationAsync(notification, "World");
first i tried it on my previously working sample app that can receive Push notification on the basis of tags also so i just tried to update its code to get template based toaste notification but unfortunately i am not getting anything..here is the code..
private void AcquirePushChannel()
{
CurrentChannel = HttpNotificationChannel.Find("mychannel");
if (CurrentChannel == null)
{
CurrentChannel = new HttpNotificationChannel("mychannel");
CurrentChannel.Open();
CurrentChannel.BindToShellToast();
CurrentChannel.BindToShellTile();
}
CurrentChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(async (o, args) =>
{
var tags = new HashSet<string>();
tags.Add("World");
var hub = new NotificationHub("samplenotificationhub", "Endpoint=sb://samplenotificationhub-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=");
var template = String.Format(#"<toast><visual><binding template=""ToastText01""><text id=""1"">$(News_English)</text></binding></visual></toast>");
await hub.RegisterTemplateAsync(args.ChannelUri.ToString(),template,"hello", tags);
// await hub.RegisterNativeAsync(args.ChannelUri.ToString(),tags);
});
}
so if you know anything about it..please guide me any kind of help or suggetion is appreciated..
Hello Friends I again able to solve my problem so the mistake i am doing here is i am following the link blindly as it is for Windows store apps and i wanted to implemented the same for windows phone 8 so what i am doing wrong is using the same Tamplate that is used in windows store apps for windows phone 8 too. so what i understand is this if wanted to target the multiple platforms from a notification hub then your client app that send the toast notification has the same notification for all but all your platform will handle it differently Like for windows 8 the tamplate i am using will work but windows phone this template will work.
string toast = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1>Hello Windows phone</wp:Text1>" +
"</wp:Toast> " +
"</wp:Notification>";
so different platform will have different platform.hope it help somebody else too.

Resources