Zeroconf
This plugin allows you to browse and publish Zeroconf/Bonjour/mDNS services.
Cordovaの問題で困っていますか?
本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。
インストール
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、エンタープライズプラグインに興味があれば 連絡ください
サポートしているプラットフォーム
- Android
- iOS
利用方法
React
Angular
import { Zeroconf } from '@ionic-native/zeroconf/ngx';
constructor(private zeroconf: Zeroconf) { }
...
// watch for services of a specified type
this.zeroconf.watch('_http._tcp.', 'local.').subscribe(result => {
if (result.action == 'added') {
console.log('service added', result.service);
} else {
console.log('service removed', result.service);
}
});
// publish a zeroconf service of your own
this.zeroconf.register('_http._tcp.', 'local.', 'Becvert\'s iPad', 80, {
'foo': 'bar'
}).then(result => {
console.log('Service registered', result.service);
});
// unregister your service
this.zeroconf.unregister('_http._tcp.', 'local.', 'Becvert\'s iPad');

