Flutter

Adrop ์ดˆ๊ธฐํ™”ํ•˜๊ธฐ

  • Adrop ์„ Importํ•˜์„ธ์š”.

  • ํ”„๋กœ์ ํŠธ์˜ ๋Ÿฐํƒ€์ž„ ๋ผ์ดํ”„์‚ฌ์ดํด ์ดˆ๊ธฐ์—, ๊ฐ€๊ธ‰์ ์ด๋ฉด ์‹œ์ž‘ ์‹œ Adrop์„ ์ดˆ๊ธฐํ™”ํ•ด์ฃผ์„ธ์š”.

import 'package:adrop_ads_flutter/adrop_ads_flutter.dart';

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);
  }
}

๋งŒ์•ฝ ํ”„๋กœ๋•์…˜์ด ์‹คํŒจํ•œ๋‹ค๋ฉด, ์—๋Ÿฌ ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Log Events

์ปค์Šคํ…€ ์ด๋ฒคํŠธ๋ฅผ ๊ธฐ๋กํ•˜์—ฌ ์šด์˜ ์ค‘์ธ ์•ฑ์˜ ์‚ฌ์šฉ์ž๋ฅผ ์„ธ๊ทธ๋จผํŠธ๋กœ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

AdropMetrics์— ๋Œ€ํ•ด ๋” ์•Œ์•„๋ณด์„ธ์š”.

AdropMetrics.logEvent("event_name", {
    "data_key_1": 1,
    "data_key_2": 1.2,
    "data_key_3": true,
    "data_key_4": "value_text"
});

Last updated