「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
Flutter の step by step(其の二)。
CIBAのAD実装の準備
HTTPパッケージを追加する必要がある。
import 'package:http/http.dart';
void sendRequest() {
http
.get(url)
.then((response) {
print(response);
})
.catchError((error) => print(error));
}Future<void> sendRequest() async {
try {
final response = await http.get(url);
print(response);
} on Exception caach (error) {
print(error);
}
}...
var response = await http.post(
"https://www.example.com/path/to/api",
body: {
"nickname": "chooyan",
"description": "A freelance mobile app developer",
},
);url_launcherパッケージを追加する必要がある。
import 'package:url_launcher/url_launcher.dart';
_launchURL() async {
const url = "http://https://www.google.co.jp/";
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not Launch $url';
}
}
以下の定義をAndroidManifest?.xmlに追加する。
<!-- Deep Links --> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="app" android:host="app_a" /> </intent-filter>
<!-- App Links --> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="example.com" /> </intent-filter>
ロケーション・バー直では、動かないとのこと。
以下のHTMLを作成し、ソコから飛んでみる。
<!DOCTYPE html>
<html>
<body>
<a href="app://app_a/">App Aに飛ぶ</a>
</body>
</html><!DOCTYPE html>
<html>
<body>
<a href="http://example.com/">App Aに飛ぶ</a>
</body>
</html>...公式URL...
前述のダウンロード・ファイルを、Android、iOS、
其々のプラットフォーム向けのビルド・プロセスへ組み込む。
firebase_messagingパッケージを追加する必要がある。
import 'package:firebase_messaging/firebase_messaging.dart';
CRUDを実装してみる。