<commit_before># Firebase Messaging Quickstart

The Firebase Messaging Unity Sample demonstrates receiving messages from
from
[Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/)
using the
[Firebase Unity SDK](https://firebase.google.com/docs/unity/setup).


## Requirements

* [Unity](http://unity3d.com/) 5.3 or higher.
* [Xcode](https://developer.apple.com/xcode/) 7.3 or higher
  (when developing for iOS).
* [Android SDK](https://developer.android.com/studio/index.html#downloads)
  (when developing for Android).


## Building the Sample

### iOS

  - Register your iOS app with Firebase.
    - Create a project in the
      [Firebase console](https://firebase.google.com/console/),
      and associate your iOS application.
      - You should use `com.google.firebase.unity.messaging.testapp` as the
        package name while you're testing.
        - If you do not use the prescribed package name you will need to update
          the bundle identifier as described in the
          `Optional: Update the Project Bundle Identifier` below.
    - Associate the project with an
      [APNs certificate](https://firebase.google.com/docs/cloud-messaging/ios/certs)
      - Inside your project in the Firebase console, select the gear icon,
        select `Project Settings`, and then select the `Cloud Messaging` tab.
      - Select the `Upload Certificate` button for your development
        certificate, your production certificate, or both. At least one is
        required.
      - For each certificate, select the .p12 file, and provide the password,
        if any. Make sure the bundle ID for this certificate matches the
        bundle ID of your app. Select Save.
    - Download the `GoogleService-Info.plist` file associated with your
      Firebase project from the console.
      This file identifies your iOS app to the Firebase backend, and will
      need to be included in the sample later.
    - For further details please refer to the
      [general instructions](https://firebase.google.com/docs/ios/setup)
      which describes how to configure a Firebase application for iOS.
  - Download the [Firebase Unity SDK](https://firebase.google.com/download/unity)
    and unzip it somewhere convenient.
  - Open the sample project in the Unity editor.
    - Select the `File > Open Project` menu item.
    - Click `Open`.
    - Navigate to the sample directory `testapp` in the file dialog and click
      `Open`.
  - Open the scene `MainScene`.
    - Navigate to `Assets/TestApp/MainScene` in the `Project` window.
    - Double click on `MainScene` file to open.
  - Import the `Firebase Messaging` plugin.
    - Select the `Assets > Import Package > Custom Package` menu item.
    - Import `FirebaseMessaging.unitypackage` from the
      [Firebase Unity SDK](https://firebase.google.com/download/unity),
      downloaded previously.
    - Click the `Import` when the `Import Unity Package` window appears.
  - Add the `GoogleService-Info.plist` file to the project.
    - Navigate to the `Assets\TestApp` folder in the `Project` window.
    - Drag the `GoogleService-Info.plist` downloaded from the Firebase console
      into the folder.
      
      NOTE: `GoogleService-Info.plist` can be placed anywhere in the project.
  - Optional: Update the Project Bundle Identifier
    - If you did not use `com.google.firebase.unity.messaging.testapp`
      as the project package name you will need to update the sample's Bundle
      Identifier.
      - Select the `File > Build Settings` menu option.
      - Select `iOS` in the `Platform` list.
      - Click `Player Settings`
      - In the `Player Settings` panel scroll down to `Bundle Identifier`
        and update the value to the package name you provided when you
        registered your app with Firebase.
  - Build for iOS
    - Select the `File > Build Settings` menu option.
    - Select `iOS` in the `Platform` list.
    - Click `Switch Platform` to select `iOS` as the target platform.
    - Wait for the spinner (compiling) icon to stop in the bottom right corner
      of the Unity status bar.
    - Click `Build and run`, when Xcode opens stop the build.
      - *NOTE* If you click `Build and run` and let the sample run, it will
        not be able to receive messages.
    - Configure the Xcode project for push messaging.
      - Select the `Unity-iPhone` project from the `Navigator area`.
      - Select the `Unity-iPhone` target from the `Editor area`.
      - Select `Capabilities` from the `Editor area`.
      - Switch `Push Notifications` to `On`.
      - Scroll down to `Background Modes` and switch it to `On`.
      - Tick the `Remote notifications` box under `Background Modes`.
    - Build the Xcode project by selecting `Project->Run` from the menu.
  - See the *Using the Sample* section below.


### Android

  - Register your Android app with Firebase.
    - Create a project in the
      [Firebase console](https://firebase.google.com/console/),
      and attach your Android app to it.
      - You should use `com.google.firebase.unity.messaging.testapp` as the
        package name while you're testing.
        - If you do not use the prescribed package name you will need to update
          the bundle identifier as described in the
          `Optional: Update the Project Bundle Identifier` below.

      - To [generate a SHA1](https://developers.google.com/android/guides/client-auth),
        first you will need to set the keystore in the Unity project.
        - Locate the `Publishing Settings` under `Player Settings`.
        - Select an existing keystore, or create a new keystore using the toggle.
        - Select an existing key, or create a new key using "Create a new key".
      - After setting the keystore and key, you can generate a SHA1 by<commit_msg>Integrate Latest @ 144876476<commit_after># Firebase Messaging Quickstart

The Firebase Messaging Unity Sample demonstrates receiving messages from
from
[Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/)
using the
[Firebase Unity SDK](https://firebase.google.com/docs/unity/setup).


## Requirements

* [Unity](http://unity3d.com/) 5.3 or higher.
* [Xcode](https://developer.apple.com/xcode/) 7.3 or higher
  (when developing for iOS).
* [Android SDK](https://developer.android.com/studio/index.html#downloads)
  (when developing for Android).


## Building the Sample

### iOS

  - Register your iOS app with Firebase.
    - Create a project in the
      [Firebase console](https://firebase.google.com/console/),
      and associate your iOS application.
      - You should use `com.google.firebase.unity.messaging.testapp` as the
        package name while you're testing.
        - If you do not use the prescribed package name you will need to update
          the bundle identifier as described in the
          `Optional: Update the Project Bundle Identifier` below.
    - Associate the project with an
      [APNs certificate](https://firebase.google.com/docs/cloud-messaging/ios/certs)
      - Inside your project in the Firebase console, select the gear icon,
        select `Project Settings`, and then select the `Cloud Messaging` tab.
      - Select the `Upload Certificate` button for your development
        certificate, your production certificate, or both. At least one is
        required.
      - For each certificate, select the .p12 file, and provide the password,
        if any. Make sure the bundle ID for this certificate matches the
        bundle ID of your app. Select Save.
    - Download the `GoogleService-Info.plist` file associated with your
      Firebase project from the console.
      This file identifies your iOS app to the Firebase backend, and will
      need to be included in the sample later.
    - For further details please refer to the
      [general instructions](https://firebase.google.com/docs/ios/setup)
      which describes how to configure a Firebase application for iOS.
  - Download the [Firebase Unity SDK](https://firebase.google.com/download/unity)
    and unzip it somewhere convenient.
  - Open the sample project in the Unity editor.
    - Select the `File > Open Project` menu item.
    - Click `Open`.
    - Navigate to the sample directory `testapp` in the file dialog and click
      `Open`.
  - Open the scene `MainScene`.
    - Navigate to `Assets/TestApp/MainScene` in the `Project` window.
    - Double click on `MainScene` file to open.
  - Import the `Firebase Messaging` plugin.
    - Select the `Assets > Import Package > Custom Package` menu item.
    - Import `FirebaseMessaging.unitypackage` from the
      [Firebase Unity SDK](https://firebase.google.com/download/unity),
      downloaded previously.
    - Click the `Import` when the `Import Unity Package` window appears.
  - Add the `GoogleService-Info.plist` file to the project.
    - Navigate to the `Assets\TestApp` folder in the `Project` window.
    - Drag the `GoogleService-Info.plist` downloaded from the Firebase console
      into the folder.
      
      NOTE: `GoogleService-Info.plist` can be placed anywhere in the project.
  - Optional: Update the Project Bundle Identifier
    - If you did not use `com.google.firebase.unity.messaging.testapp`
      as the project package name you will need to update the sample's Bundle
      Identifier.
      - Select the `File > Build Settings` menu option.
      - Select `iOS` in the `Platform` list.
      - Click `Player Settings`
      - In the `Player Settings` panel scroll down to `Bundle Identifier`
        and update the value to the package name you provided when you
        registered your app with Firebase.
  - Build for iOS
    - Select the `File > Build Settings` menu option.
    - Select `iOS` in the `Platform` list.
    - Click `Switch Platform` to select `iOS` as the target platform.
    - Wait for the spinner (compiling) icon to stop in the bottom right corner
      of the Unity status bar.
    - Click `Build and run`, when Xcode opens stop the build.
      - *NOTE* If you click `Build and run` and let the sample run, it will
        not be able to receive messages.
    - Configure the Xcode project for push messaging.
      - Select the `Unity-iPhone` project from the `Navigator area`.
      - Select the `Unity-iPhone` target from the `Editor area`.
      - Select the `General` tab from the `Editor area`.
      - Scroll down to `Linked Frameworks and Libraries` and click the `+`
        button to add a framework.
        - In the window that appears, scroll to `UserNotifications.framework`
          and click on that entry, then click on `Add`. This framework will only
          appear in Xcode version 8 and higher, required by this library.
      - Select the `Capabilities` tab from the `Editor area`.
      - Switch `Push Notifications` to `On`.
      - Scroll down to `Background Modes` and switch it to `On`.
      - Tick the `Remote notifications` box under `Background Modes`.
    - Build the Xcode project by selecting `Project->Run` from the menu.
  - See the *Using the Sample* section below.


### Android

  - Register your Android app with Firebase.
    - Create a project in the
      [Firebase console](https://firebase.google.com/console/),
      and attach your Android app to it.
      - You should use `com.google.firebase.unity.messaging.testapp` as the
        package name while you're testing.
        - If you do not use the prescribed package name you will need to update
          the bundle identifier as described in the
          `Optional: Update the Project Bundle Identifier` below.

      - To [generate a SHA1](https://developers.google.com/android/guides/client-auth),
        first you will need to set the keystore in the Unity project.
        - Locate the `Publishing Settings` under `Player Settings`.
        - Select an existing keystore, or create a new keystore using the toggle.
        - Select an existing key, or create a new key using "Create a new key".
      - After setting the keystore and key, you can generate a SHA1 by
{'fraction_non_alphanumeric': 0.07849489160229255, 'fraction_numerical': 0.0023257745659938534, 'mean_word_length': 2.835616438356164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '895770', 'n_tokens_mistral': 3246, 'n_tokens_neox': 3108, 'n_words': 1438}