Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
react-native-bluemix
Advanced tools
React Native module (ios and android) for using select Bluemix services. Access to Watson services is provided by wrapping the Watson Developer Cloud
npm install --save react-native-bluemix
Android installation is done with react-native link react-native-bluemix
minSdkVersion 19 targetSdkVersion 26
Copy RNBluemix.m and RNBluemix.swift from node_modules/react-native-bluemix/ios into your project. You will be prompted to create a bridging header. Accept and place the below into the header:
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
We recommend using Carthage to manage dependencies and build the Swift SDK for your application.
You can install Carthage with Homebrew:
$ brew update
$ brew install carthage
Then, navigate to the root directory of your project (where your .xcodeproj file is located) and create an empty Cartfile
there:
$ touch Cartfile
To use the Watson Developer Cloud Swift SDK in your application, specify it in your Cartfile
:
github "watson-developer-cloud/swift-sdk"
In a production app, you may also want to specify a version requirement.
Then run the following command to build the dependencies and frameworks:
$ carthage update --platform iOS
Drag-and-drop the built frameworks into your Xcode project (put them in a Frameworks group for better management). You will also need to click on your project in Xcode and go to the General section. Add all of the frameworks to Embedded Binaries.
Note, before you can upload to itunesconnect your will need to strip unwanted architectures from the frameworks. This is done easily with a build script. See the following link for instructions: http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
Services are instantiated using the IBM Bluemix cloud platform.
Follow these steps to create a service instance and obtain its credentials:
username
and password
(or api_key
for Alchemy).You will need to provide these service credentials in your application. For example:
TextToSpeech.initialize("your-username-here", "your-password-here")
Note that service credentials are different from your Bluemix username and password.
See Getting Started for more information on getting started with the Watson Developer Cloud and Bluemix.
The IBM Watson Text to Speech service synthesizes natural-sounding speech from input text in a variety of languages and voices that speak with appropriate cadence and intonation.
import {TextToSpeech} from 'react-native-bluemix';
TextToSpeech.initialize("username", "password")
TextToSpeech.synthesize( "Text to speech, easy" )
Change the voice
TextToSpeech.synthesize( "Text to speech, easy", "en-US_AllisonVoice" )
Get all voices that you can use
TextToSpeech.getVoices()
.then( voices => voices.forEach( voice => console.log(voice.name) ) )
The IBM Watson Speech to Text service enables you to add speech transcription capabilities to your application. It uses machine intelligence to combine information about grammar and language structure to generate an accurate transcription.
import {SpeechToText} from 'react-native-bluemix';
SpeechToText.initialize("username", "password")
// will transcribe microphone audio
SpeechToText.startStreaming((error, text) =>
{
console.log(text)
})
SpeechToText.stopStreaming()
The IBM Watson Tone Analyzer service can be used to discover, understand, and revise the language tones in text. The service uses linguistic analysis to detect three types of tones from written text: emotions, social tendencies, and writing style.
Emotions identified include things like anger, fear, joy, sadness, and disgust. Identified social tendencies include things from the Big Five personality traits used by some psychologists. These include openness, conscientiousness, extraversion, agreeableness, and emotional range. Identified writing styles include confident, analytical, and tentative.
import {ToneAnalyzer} from 'react-native-bluemix';
ToneAnalyzer.initialize("username", "password")
ToneAnalyzer.getTone( text )
.then( toneAnalysis => console.log(JSON.stringify(toneAnalysis) )
Use Natural Language Understanding to analyze various features of text content at scale. Provide text, raw HTML, or a public URL, and IBM Watson Natural Language Understanding will give you results for the features you request. The service cleans HTML content before analysis by default, so the results can ignore most advertisements and other unwanted content.
import { NaturalLanguageUnderstanding } from 'react-native-bluemix'
NaturalLanguageUnderstanding.initialize( "username", "password" )
let contentToAnalyze = {
text: "In 2009, Elliot Turner launched AlchemyAPI to process the written word, with all of its quirks and nuances, and got immediate traction."
}
let features = {
concepts: {
limit: 5
},
categories: true
}
NaturalLanguageUnderstanding.analyzeContent( contentToAnalyze, features )
.then( results =>
{
console.log( JSON.stringify( results, null, " " ) )
} )
.catch( error => {
console.log( "Error: " + error.message )
})
FAQs
React Native module for IBM Bluemix services
The npm package react-native-bluemix receives a total of 3 weekly downloads. As such, react-native-bluemix popularity was classified as not popular.
We found that react-native-bluemix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.