openwhish app readme

OpenWhisk Logo

OpenWhisk

Bluemix Mobile Starter for OpenWhisk in Android Java


Table of Contents

Summary

The Bluemix Mobile Starter for OpenWhisk will showcase how you can invoke OpenWhisk actions from a Mobile App.
It contains a sample OpenWhisk action actions/pushAction.js that will trigger a push notification from OpenWhisk and notifiy the Mobile App that invoked it.

Requirements

  • Android Studio
  • OpenWhisk namespace
  • OpenWhisk Auth Header

Configuration

Setup the OpenWhisk.

For OpenWhisk setup, you need to get authentication from Bluemix OpenWhisk. Install OpenWhisk CLI and Auth.

After following the instructions to configure your openwhisk CLI, navigate to app\src\main\res\values\open_whisk_credentials.xml and use the same values to set the namespace and auth header.

Create Whisk Action

If you plan on enabling push notifications in your Android app, you must follow the Firebase configuration settings. Mainly adding the 2 package names to your Firebase console and updating the google-play-services.json in your Android app. Start at “Complete the following steps using the Firebase Cloud Messaging (FCM) console.”

Once complete, use the following WSK CLI command to create your push action in OpenWhisk. Don’t worry about editing the js file, your push instance app secret has been populated automatically.

wsk action update pushAction actions/pushAction.js

To see the fully qualified name, run in the CLI:

wsk action get --summary pushAction

Qualified names are formatted by /namespace/package/action(or trigger)name.

An example of a qualified name is tcheng@us.ibm.com_dev, which means:

namespace = tcheng@us.ibm.com_dev
authHeader = long string after -auth, formatted like openwhisk appid:auth password

Please set the namespace and auth header accordingly in the app\src\main\res\values\open_whisk_credentials.xml (as mentioned above).

Run

After importing into Android Studio, build and run the generated mobile application. You will be greeted with a list of your personal namespace’s OpenWhisk actions. Select an action and see the response displayed in real time.

License

This package contains code licensed under the Apache License, Version 2.0 (the “License”). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 and may also view the License in the LICENSE file within this package.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不对法

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值