PushNotification -- no device found - ibm-mobilefirst

I have a hybrid app and having some issue seeing notification..
I get the error
com.ibm.pushworks.server.exceptions.PushWorksException: FPWSE0009E: Internal server error. No devices found
I running on Local MFP (eclipse -- V7.1).. I see the device in the worklightconsole and the app is install on my phone (Xcode->phone via USB) and I see the opt-in notification message.. However, I get the error when I tried to send a push..
I am using postman and the restAPI
http://localhost:10080/worklightadmin/management-apis/1.0/runtimes/MyMobile/notifications/applications/myProj/messages
Here is the body of the post request
{
"message": {
"alert": "Test message"
},
"settings": {
"apns": {
"badge": 1,
"iosActionKey": "Ok",
"payload": {},
"sound": "song.mp3"
},
"gcm": {
"payload": {},
"sound": "song.mp3"
}
},
"target": {
"consumerIds": [],
"deviceIds": ["166CB698-45C2-4C61-9074-248EA4F8AA8F"],
"platforms": [
"A","G"
]
}
}
Can you give some hints to solve this issue ..
Thanks

As Vivin mentioned in the comments, your device ID may be wrong.
The same JSON works for me , in my local setup. Is it possible the device id you entered is wrong? With the current parameters within "target" you can get the error message only if the device id is wrong.

Related

Web Activity endless running In Azure Data Factory

Currently it seems that web activity is broken.
When using simple pipeline
{
"name": "pipeline1",
"properties": {
"activities": [
{
"name": "Webactivity",
"type": "WebActivity",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "https://www.microsoft.com/",
"connectVia": {
"referenceName": "AutoResolveIntegrationRuntime",
"type": "IntegrationRuntimeReference"
},
"method": "GET",
"body": ""
}
}
],
"annotations": []
}
}
When debugging it never finishes. There is "in progress" for several minutes.
I tried Web hook and it works.
Is there something else I could try?
A quick note on the "never finishes" issue: one of my pet peeves with Data Factory is that the default timeout for all activities is 7 DAYS. While I've had a few activities that needed to run for 7 hours, a WEEK is a ridiculous default timeout value. One of the first things I do in any production scenario is address the timeout values of all the activities.
As to the Web activity question: I set up a quick example in my test bed and it returned just fine:
Looking at the generated code, the only real difference I see is the absence of the "connectVia" property that was in your example:
Ok I've found it.
The default AutoResolveIntegrationRuntime only had managed private network which I couldn't change. So I created a new Integration Runtime with public network setting.
This is a litte bit strange as I started today with a brand new Azure Data Factory.
I wonder why I cannot change the default Integration Runtime to disable virtual network:

Netcore server respond to slack interactive message

I am trying to build Slack application with asp net core server. Currently, I have added Slash command which makes a request to my local server through ngrok. Once my server receives that request, it makes a post request to configured slack webhook to display interactive message which looks like pic from attachment.
I want user to be able to select yes or no and receive the result in my controller, but I can't realize how to tell Slack where should it make a post request. I attach the code of this message which is posted through weebhook into Slack:
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "This is a section block with a button."
}
},
{
"type": "actions",
"block_id": "actionblock789",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Yes"
},
"style": "primary",
"value": "yes"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "No"
},
"value": "no"
}
]
}
]
}
What I have in netcore is TestController with route /api/test which I suppose should receive from Slack a payload where information about selected button is set, but I couldn't find a way where specify a url in this json code.
You can not configure a URL in the JSON code. That is not how it works with the Slack API.
Slack will send all responses to interactive message - like when someone clicks on a button - to the configured request URL of your Slack app. Check out this link how to find that parameter: documentation

Why is "create" undefined for Edge extension notifications?

Running code in Edge extension throws a TypeError, unable to get property 'create' of undefined or null reference.
I have tried running it in both the popup and background scripts. I have the notifications permissions in the manifest. I did see that some APIs require being run in the content script, but since I'm not engaging the tabs or web pages, I don't think that applies to me...?
Manifest:
{
"name": "xxx",
"author": "xxx", "version": "1.1",
"options_page": "options.html",
"background": {
"scripts": ["jquery-3.3.1.min.js","background.js"], "persistent": true
},
"permissions": [
"xxx",
"background",
"notifications",
"storage"
],
"offline_enabled": true,
"browser_action": {
"default_title": "xxx",
"default_popup": "popup.html",
"default_icon": "32.png"
},
"manifest_version": 2
}
Background script:
try{
browser.notifications.create("test",{
"type": "basic",
"title": "Test",
"iconUrl": "48.png",
"message": "This is a test"
});
}catch(e){
alert(e);
}
Based on your description, first, you could try to upgrade the Edge browser to the latest version, then, try to use the browser.notifications.create method.
But, in my opinion, I prefer to display the notification using the Web Notifications API, you could check this article.

Events received by client websocket as a consequence of calling builder.Prompts.text() in a bot are missing the activity payload

botframework Node.js [DirectLine 3.0 API / React Native Client (Android)] Events received by client websocket as a consequence of calling builder.Prompts.text() in a bot are missing the ‘data’ property (i.e. the activity payload).
Version Information
React Native Client (Android)
Node.js v7.5.0
react-native v0.41.2
Bot
Node.js v6.3.1
botbuilder v3.7.0
DirectLine
API v3.0
Description of Issue
Events received by client websocket as a consequence of calling builder.Prompts.text() in a bot are missing the ‘data’ property (i.e. the activity payload).
Note: Subsequent events following this one will include the Symbol ‘original_event’ which includes the missing event details that would have been expected in the initial event.
Direct Line request from bot (i.e. captured from ChatConnector.authenticatedRequest()):
{
json: true,
method: “POST”,
url: “https://state.botframework.com/v3/botstate/directline/conversations/[MY CONVERSATION ID]”,
body: {
from: {
id: “MyBot#ZSXyfFggVqW”,
name: “MyBot”
},
recipient: {
id: “MyClientId”
},
text: “Hi Pete, please enter the code displayed in the browser page to complete the sign in process.”,
type: “message”
}
}
Event received by websocket:
{
… // Expecting a data property at this level. Don’t confuse this with the data property in the Symbol below, which is for the previous event.
Symbol(original_event): {
data: "{
"activities": [
{
"type": "typing",
"id": "[MY CONVERSATION ID]|5ChLjtMKBEz",
"timestamp": "2017-05-04T10:37:48.3923201Z",
"channelId": "directline",
"from": {
"id": "MyBot",
"name": "MyBot"
},
"conversation": {
"id": "[MY CONVERSATION ID]"
}
}
]}",
type: ”message”
},
timestamp: 1493894269211,
type: “message”
}
Event after the one above contains:
{
…
Symbol(original_event): {
data: "{
"activities": [
{
"type": "message",
"id": "[MY CONVERSATION ID]|0000030",
"timestamp": "2017-05-04T10:37:49.092354Z",
"channelId": "directline",
"from": {
"id": "MyBot",
"name": "MyBot"
},
"conversation": {
"id": "[MY CONVERSATION ID]"
},
"text": "Hi Pete, please enter the code displayed in the browser page to complete the sign in process.”
}
],
"watermark": "30"
}",
type: ”message”
},
timestamp: 1493894511787,
type: “message”
}
Notes:
• Notice that the event following the original has the data property we would have expected, contained in the Symbol “original_event”.
• If the same conversation thread is attempted for any other channel type, the message “Hi Pete, please enter the code displayed in the browser page to complete the sign in process” IS shown in the chat window (i.e. Skype, Slack, Web Chat etc). It is only direct line that appears to have the issue.
• The message in question is a proactive message triggered after a user has been authenticated and a redirect URL called. The message is required to prompt the user for a second form of authentication, in this particular case an access code.
• If all historic message activities are requested for the above conversation, the missing message is among said activities i.e.:
https://directline.botframework.com/v3/directline/conversations/[MY CONVERSATION ID]/activities?watermark=[INITIAL WATERMARK]
{
"activities": [
…
{
"type": "message",
"id": "[MY CONVERSATION ID]|0000009",
"timestamp": "2017-05-04T17:48:33.0747342Z",
"channelId": "directline",
"from": {
"id": "MyBot"
},
"conversation": {
"id": "[MY CONVERSATION ID]"
},
"text": "Hi Pete, please enter the code displayed in the browser page to complete the sign in process."
}
…
Any suggestions?
Update 05/05/2017
Currently pursing two avenues of thought, either there is an issue with the WebSocket library bundled with React Native, or we have a general Direct Line WebSocket issue (a colleague of mine will be retesting with a native IOS client this morning to confirm one way or another).
No longer an issue. Websocket events now appear to be coming through as expected.

Taking screenshots with Selenium Builder

Using Selenium Builder, I've created the following json file:
{
"type": "script",
"seleniumVersion": "2",
"formatVersion": 2,
"steps": [
{
"type": "get",
"url": "http://stackoverflow.com/"
},
{
"type": "saveScreenshot",
"file": foo.png"
}
],
"data": {
"configs": {},
"source": "none"
},
"inputs": [],
"timeoutSeconds": 60
}
I tried running it on Windows 7 and two different Ubuntu machines. Instead of the filepath "foo.png" I had also inserted "E:\foo.png" / "/home/swege/foo.png". However, I always get the "exception":
Could not take screenshot of current page - [object Object]
At least I would like to be able to read the "error object", but every system just puts out that the error is a JavaScript object. Any idea how to fix the issue or read the full error message?
Try following :
http://www.ontestautomation.com/how-to-create-screenshots-in-your-selenium-webdriver-tests/
Above can help you to get exact code that how you can take screenshots using selenium.
So I pulled down and looked at the source for Selenium Builder 2 and found two files that I think show the origin of the error, command_processor.js and driver_component.js.
I can't make out why the error is occurring - maybe someone here can build on this?
Try using a full file path, not just foo.png. On Mac, these worked for me: ~/foo.png and ~/Downloads/screenshots/foo.png.
It's also important that the folder exists and is writable by the account running the web browser.