React native module for libtransmission.
Only for Android for now.
# Install vcpkg, and install required packages
vcpkg install \
curl:x86-android openssl:x86-android \
curl:x64-android openssl:x64-android \
curl:arm-android openssl:arm-android \
curl:arm64-android openssl:arm64-android
npm install react-native-transmission
import Transmission from 'react-native-transmission'
const tr = new Transmission(
'/data/data/com.transmissionexample/files/configDir',
'transmission'
)
// Beware to correctly set the download dir when your app load,
// as default location is not correct by default on android yet.
tr.request(
{
method: 'session-set',
arguments: {
'download-dir': '/data/data/com.transmissionexample/files/downloads',
}
}, (err, res) => {}
)
tr.request(
{
method: 'session-get',
arguments: {
fields: ['version'],
},
},
(err, res) => {
if (err) {
console.error(err)
}
console.log(res)
}
)
// Or use tr.request as a promise
const res = await tr.request(
{
method: 'session-get',
arguments: {
fields: ['version'],
},
}
)
console.log(res)
tr.close()
See the contributing guide to learn how to contribute to the repository and the development workflow.
GPL-v3
Made with create-react-native-library