Flutter
1
사전 준비 사항
Adrop은 다음의 환경에서 동작합니다.
안드로이드 :
API 레벨 23(M) 혹은 그 이상을 타겟팅
Android 6.0 혹은 그 이상 버전을 사용
minSdkVersion23
다음의 버전을 충족하는 Jetpack (AndroidX)을 사용
com.android.tools.build:gradlev7.6.3 버전 이상compileSdkVersion34
Kotlin 2.1.0 버전 이상
iOS:
iOS 13
Swift 5.0
다음 사항을 포함하여 운영체제에 맞게 Flutter 를 설치해주세요:
Flutter SDK
Supporting libraries
특정 플랫폼에 최적화된 소프트웨어와 SDK
2
3
Adrop 초기화(Initialize)하기
마지막으로, 앱 시작 시 Adrop을 초기화 하기 위하여 프로젝트 루트 위젯에 하단 초기화 코드를 추가해 주세요.
Adrop 플러그인을 import하세요.
import 'package:adrop_ads_flutter/adrop_ads_flutter.dart';앱 시작 시, Adrop을 초기화하세요.
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
initialize();
}
Future<void> initialize() async {
// ..
// true for production
await Adrop.initialize(false); // production 파라미터를 false로 전달할 경우, SDK내에서 발생하는 로그가 출력됩니다.
}
}Flutter 애플리케이션을 리빌드해주세요.
flutter run4
TroubleShooting
# Add this line to your Podfile
use_frameworks!
# ...
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
#...
# Add this line to your Podfile
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
endLast updated