정확한 위치 데이터 정책

Google 게시자 정책이 최근 업데이트되면서 광고 관련 목적으로 사용자의 정확한 위치 데이터를 Google에 전달하는 게시자를 위한 새로운 알림 및 동의 요건이 도입되었습니다.

이 정책이 적용되는 경우 아래 스니펫은 사용자에게 이러한 데이터 공유에 관해 알릴 수 있는 한 가지 방법을 보여줍니다.

Java

protected void presentConsentOverlay(Context context) {
  new AlertDialog.Builder(context)
      .setTitle("Location data")
      .setMessage("We may use your location, " +
          "and share it with third parties, " +
          "for the purposes of personalized advertising, " +
          "analytics, and attribution. " +
          "To learn more, visit our privacy policy " +
          "at https://myapp.com/privacy.")
  .setNeutralButton("OK", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
      dialog.cancel();
      // TODO: replace the below log statement with code that specifies how
      // you want to handle the user's acknowledgement.
      Log.d("MyApp", "Got consent.");
    }
  })
  .show();
}

// To use the above method:
presentConsentOverlay(this);

Kotlin

protected fun presentConsentOverlay(context: Context) {
  AlertDialog.Builder(context)
      .setTitle("Location data")
      .setMessage("We may use your location, " +
          "and share it with third parties, " +
          "for the purposes of personalized advertising, " +
          "analytics, and attribution. " +
          "To learn more, visit our privacy policy " +
          "at https://myapp.com/privacy.")
      .setNeutralButton("OK") { dialog, which ->
        dialog.cancel()
        // TODO: replace the below log statement with code that specifies how
        // you want to handle the user's acknowledgement.
        Log.d("MyApp", "Got consent.")
      }
      .show()
}

// To use the above function:
presentConsentOverlay(this)