TideSDK Notifications in OSX Lion 10.7.5 - tidesdk

I started using the tideSDK for a simple desktop application. Im using the notification api. This works on Windows platforms but not on my OSX Lion 10.7.5.
This is the notification code from the TideSDK docs tideSDK docs
doSomething = () ->
alert "nice!"
notification = Ti.Notification.createNotification(
title: "Notification from App"
message: "Click here for updates!"
timeout: 10
callback: doSomething
icon: "app://img/icon.png"
)
notification.show()
SO like a said this works on Windows, so the code seems to be correct, but not on OSX. Any ideas ?
Im using version 1.4.2 of the developer SDK, according to what I read it supposed to work with Growl

Harry, I'm not too familiar with CoffeeScript, but the following code works for me in 10.7.5 and 10.8.4 - it seems similar to what you have:
function showNotify(title, message) {
var notification = Ti.Notification.createNotification({
'title': title || 'No Title',
'message': message || 'No Message',
'timeout': 10
});
notification.show();
}
showNotify("The Title", "The Message");
Hope it helps.

Related

Web Simulator showing "My Test App isn't responding right now. Try again soon" when I run "Talk to My Test App"

I started a new new app with actions on google and when I run the simulator I'm receiving this message "My Test App isn't responding right now. Try again soon".
I am using firebase to deploy my fulfilment which looks like this
const functions = require("firebase-functions");
const App = require("actions-on-google").DialogflowApp;
const firebase = require("firebase");
const firebaseAdmin = require("firebase-admin");
firebaseAdmin.initializeApp(functions.config().firebase);
exports.cabDemo = functions.https.onRequest((request, response) => {
const app = new App({ request, response });
const BOOK_TAXI = "book.taxi";
debugger;
function bookTaxi(app) {
app.ask("Currently looking for taxis now. Anything else?");
}
const actionMap = new Map();
actionMap.set(BOOK_TAXI, bookTaxi);
app.handleRequest(actionMap);
});
I have tested this and it deployed correctly yesterday and when I tried to run it this morning it gave me that not responding message. It still deploys correctly but I cannot test it on the simulator.
I have the actions on google project and api.ai projects linked properly so I don't think this is the problem. But I could easily be wrong.
The response from the web simulator is
{
"audioResponse": "//NExAARsE...",
"conversationToken": "GidzaW11bG...",
"response": "Cabforce demo isn't responding right now. Try again soon.",
"visualResponse": {
"visualElements": []
}
}
and the DEBUG message is:
{
"agentToAssistantDebug": {},
"assistantToAgentDebug": {}
}
This is a duplicate of another question on Stack Overflow => here
There was no solution so I had to repost the question.
I'm receiving the same response and debug message.
All help would be great, thanks !
Ok, I may have stumbled on a fix. It looks like you can now trigger test apps by their name.
Go to https://console.actions.google.com
Select your app
Click Edit under "App Information" (#2)
Give the app a name and pronunciation
Click "Test Draft" (at the bottom)
Invoke the app by name
Hope that works for you. Seemed to work for me.

Implementing Local Notifications in Xamarin.Forms using Xam.Plugins.Notifier

i have implemented Local Notifications in Xamarin.Forms using Xam.Plugins.Notifier. I have added the Nuget Package in PCL, iOS and Android.
below code is displaying the notification. i wrote the below chunk of code in my PCL
CrossLocalNotifications.Current.Show("test" + " " + " New test", "Some Notification", 5,DateTime.Now.AddSeconds(8));
I have added the below code in AppDelegate.CS
if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
{
// iOS 10.0+
UNUserNotificationCenter.Current.RequestAuthorization(
UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound,
(approved, error) => { });
UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();
}
I am able to get the notification in iOS but am not getting the notification in Android. Do i need add any code in MainActivity.cs
can someone help me to fix this?
FYI: https://github.com/edsnider/LocalNotificationsPlugin
As the document said, your code :
CrossLocalNotifications.Current.Show("test" + " " + " New test", "Some Notification", 5, DateTime.Now.AddSeconds(8));
It will display a local notification at a scheduled date/time, your notification will display after 8s delay.
If you want display a local notification immediately, you could try using :
CrossLocalNotifications.Current.Show("title", "body");
It works fine on my side.
Update :
You were missing something to display a notification .
As per the official documentation:
a Notification object must contain the following:
A small icon, set by SetSmallIcon()
A title, set by SetContentTitle()
Detail text, set by SetContentText()
See http://developer.android.com/guide/topics/ui/notifiers/notifications.html

SkypeSDK Video and audio issue - mediaRelayAccessToken not found

I'm having problems with adding an audio or a video service to a coversation.
The chat service works fine for me.
When I add a video or an audio service I get following error:
Error: GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404
{
[functions]: ,
__proto__: { },
code: "RequestFailed",
description: "GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404",
message: "GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404",
name: "Error",
req: { },
rsp: { },
stack: "Error: GET /ucwa/oauth/v1/applications/113925534802/communication/mediaRelayAccessToken failed: 404
at process (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8079:29)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8018:29)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:1714:25)
at map (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:1331:25)
at decompose (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8017:25)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8007:29)
at handle (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:2220:33)
at Anonymous function (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:698:25)"
}
The Skype For Business Plugin is installed and works fine.
A Skype Edge server is currently not installed.
I'm using Internet Explorer 11.
The error occurs with the Skype Web SDK On Prem Sample from Microsoft as well as on my own website.
When I try to add video or audio for the second time to the same conversation i dont get any error message at all, but it still doesn't work. The request doesnt show up in the dev tools nor in fiddler. I'm using the latest version of the Skype SDk bootstrapper.
Both clients and server are in the same subnet.
Thanks in advance.
I encountered the same problem. Not sure how it happens, but the sdk has troubles to fetch or apply the media config.
You can use the this workaround:
Following line 18,892 in the debug version of the sdk, comment out both calls:
uninit();
throw error;
in the function init() of the section MediaConfig. Resulting in:
function init() {
pcMediaConfig = mediaPlugin.createComponent({
type: 'MediaPlatformConfig',
hide: true,
inproc: false
});
pcMediaConfig.event(onPluginComponentEvent);
pcMediaConfig.state.changed(function (state) {
log('pcMediaConfig.state = ' + state);
});
var p = pcMediaConfig.load().then(getMediaConfig).then(setMediaConfig).then(null, function (error) {
log('MediaConfig::init rejected');
//uninit();
//throw error;
});
return p;
}
Therefore you have to download the bootstrapper and the sdk to permanently apply the patch. To do this just fetch both in the debug version (bootstrapper version 1.2.5) and replace in function onConfig(config) line 48
}, config.corsScript && (scriptAttributes.crossOrigin = ""), loader.loadScript(getPackageUrl(config), null, handleError, scriptAttributes);
with
}, config.corsScript && (scriptAttributes.crossOrigin = ""), loader.loadScript("./scripts/SkypeSDK.js", null, handleError, scriptAttributes);
or your equivalent path
This is currently a limitation of the Skype Web SDK: it has a dependency on the mediaRelayAccessToken to proceed with audio/video calls. The dev team is aware of this issue and it may be fixed in a future release of Skype Web SDK.
The hacky way recommended above is basically to allow the SDK to continue the call upon missing mediaRelayAccessToken, so it may let you bypass the issue.
The media relay access token is returned by an edge server, so you may also try to deploy an edge server to work around this issue.

How do I use Meteor and a Cordova BLE plugin to connect to a BLE device

I'm trying to use Meteor and this Cordova plugin -https://github.com/don/cordova-plugin-ble-central - added to my project using meteor add cordova in order to connect to a Bluetooth LE device (TI Sensortag). All I want to do to begin with is, when a link is clicked, to connect to the device and show a message.
I have the following code in the events section of my template javascript.
Template.measure.events({'click [data-action=scan-connect-stream]':
function(event, template) {
event.preventDefault();
if (Meteor.isCordova) {
Meteor.startup(function () {
ble.connect('24:09:00:DE:00:42',
function(){
alert('Connect success');
return;
},
function(){
alert('Connect failed');
return;
});
});
}
}
});
My problem is that sometimes the code works and I get a 'Connect success' alert but more often than not it it fails to connect and shows the 'Connect failed' alert. Before I added the return statements in the success and fail callbacks it didn't work at all.
I'm debugging this on an android device (meteor run android-device --verbose) and can see via adb logcat that the BLE Connect event in the Cordova plugin is firing but then doesn't connect. I get the same issue debugging on two different phones and when using a BLE device that isn't a TI Sensortag so I'm guessing this is an problem with the way the plugin is interacting with Meteor (maybe Meteor isn't waiting long enough for a success callback?).
Has anyone used this plugin successfully with Meteor or can anyone provide any clue as to what I'm doing wrong? Should I try wrapping it in a Meteor package or is there any way I can give the plugin more time to respond before the success or fail callbacks fire? Any help would be much appreciated!
For anyone who's having similar issues this is what sorted it for me. I put the ble.connect call into the success callback of the ble.scan function. Not sure why but scanning for a few seconds first does the job.
Template.measure.events({
'click [data-action=scan-connect-stream]': function(event, template) {
event.preventDefault();
if (Meteor.isCordova) {
Meteor.startup(function () {
device_id = '24:09:00:DE:00:42';
ble.scan([], 5,
function(peripherals){
connectDevice(device_id);
},
function(){
alert('No devices found');
}
);
});
}
}
});
var connectDevice = function (device_id) {
ble.connect(device_id,
function(){
alert('Device ' + device_id + ' connnected');
},
function(){
alert('Couldn\'t connect to device ' + device_id);
});
}
If anyone can explain why the ble.connect won't work on its own that'd be great!
EDIT: Looking at the Android code it seems that the plugin is designed in such a way that ble.scan has to be called before calling ble.connect. The ble.scan causes a LinkedHashMap in the Android code to be populated with any discovered devices. Only once the device is listed in the LinkedHashMap can you then connect to it using ble.connect.

Error while taking pictures using MeteorCamera.getPicture() while testing on a laptop

I am working to add a photo ability to my app using Meteor's mdg:camera plugin. For now, I don't have any PhoneGap devices setup, so I am testing on my laptop. I thought I read somewhere that the Meteor implementation would fall-back and use a simple file dialog when a camera wasn't available, but when I try to run the following code on my laptop:
var cameraOptions = {
width: 800,
height: 600
};
MeteorCamera.getPicture(cameraOptions, function (err, data) {
if (err) {
console.log(err);
// TODO Need to handle the error
} else {
if (!this.photos) {
this.photos = [];
}
this.photos.push({ submitted_by: Meteor.userId(), submitted_on: new Date(), photo_data: data});
}
});
I get the error:
Meteor.makeErrorType.errorClass {error: "unknownError", reason: "There was an error while accessing the camera.", details: undefined, message: "There was an error while accessing the camera. [unknownError]", errorType: "Meteor.Error"…}
I would actually like for users to be able to upload photos via the same button when using a laptop. For what it's worth, I actually do have a camera built-in, and I am developing on a 15" MacBook Pro.
On browser client, the mdg:camera falls back on using navigator.getUserMedia to try to obtain a video stream from the webcam, it does not allow the user to upload a photo.
https://github.com/meteor/mobile-packages/blob/master/packages/mdg:camera/photo-browser.js#L41
Unfortunately as we are speaking getUserMedia lacks support on Safari, which is probably the browser you are using working on a MacBook.
http://caniuse.com/#feat=stream
Try your application on Google Chrome or Firefox instead.

Resources