Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Vetabyte · Oct 08, 2017 at 06:44 PM · androidunity 5database

Firebase Offline Support?

I don't know why it seems that every recent Firebase question regarding this has no answer. I made an app on Android Studio using Firebase Authentication and Database that flawlessly syncs online and offline just by following the guide on their site. Unity on the other hand has no support or guide on how to do this. The "guide" on their site seems like a weak attempt to just have something there. It basically just says you can do this and that but we won't tell you how. I managed to get the DB working but not the offline support.

Is offline support even available on Unity?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by greatgirl · Dec 08, 2018 at 05:48 AM

Downloads Firebase Admob Unity Plugin Assets/Plugins is reqired admob_unity_plugin.unitypackage contain all required files and demo files Download those files from Admob Unity3d Plugin Project Home https://github.com/unity-plugins/Firebase-Admob-Unity or Download all the Unity admob plugin project https://github.com/unity-plugins/Firebase-Admob-Unity/archive/master.zip

Installation Firebase Admob Unity Open your project in the Unity editor. Navigate to Assets -> Import Package -> Custom Package. Select the admob_unity_plugin.unitypackage file. Import all of the files for the plugins by selecting Import. Make sure to check for any conflicts with files. Edit AndroidManifest.xml change the appid to your Edit /res/values/strings.xml change google_app_id to your Unzip GoogleMobileAds.framework.zip to GoogleMobileAds.framework Replace GoogleService-Info.plist with your file ,and add this this to your xcode project Add other link flag -ObjC in xcode project Unity Plugin Wiki and Documentation API Tutorial Quick Start Google Firebase Analyze FirebaseAnalytic firebase=FirebaseAnalytic.Instance();//init and start basic analysis //you can set more info as follow ,but this is optional firebase.logEvent("startevent", "{\"player\":\"yingke\"}"); firebase.setUserId("232324432"); firebase.setUserProperty("age", "20"); // firebase.setAnalyticsCollectionEnabled(true); 1.Init Firebase Admob Unity Plugin Create A C# script ,drag the script to a object on scene , add the follow code in the script file

 using admob;
 Admob.Instance().initSDK("admob id", new AdProperties());//admob id with format ca-app-pub-279xxxxxxxx~xxxxxxxx

2.Add Admob Banner in Unity App Here is the minimal code needed to show admob banner.

 Admob.Instance().showBannerRelative("your banner id",AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);

The AdPosition class specifies where to place the banner. AdSize specifies witch size banner to show

3.Remove Banner By default, banners are visible. To temporarily hide a banner, call:

 Admob.Instance().removeBanner();

4.How to integrate Interstitial into Unity 3d app? Here is the minimal code to create an interstitial.

 Admob.Instance().loadInterstitial("your interstitial id"); 

Unlike banners, interstitials need to be explicitly shown. At an appropriate stopping point in your app, check that the interstitail is ready before showing it:

 if (Admob.Instance().isInterstitialReady()) {
   Admob.Instance().showInterstitial();
 }

5.Custom Admob Banner Ad Sizes In addition to constants on AdSize, you can also create a custom size:

 //Create a 250x250 banner.
 AdSize adSize = new AdSize(250, 250);
 Admob.Instance().showBannerAbsolute("your banner id",adSize,0,30);

6.Admob settings If you want to test the ads ,non personalize ads,set tag for family or set tag for children market,you can set with admob unity plugin easy

     AdProperties adProperties = new AdProperties();
     adProperties.isTesting = true;
     adProperties.isForChildDirectedTreatment=true;
     //adProperties.isUnderAgeOfConsent=true;
     adProperties.isAppMuted=true;
     adProperties.nonPersonalizedAdsOnly=true;

7.Ad Events Both Banner and Interstitial contain the same ad events that you can register for. Here we'll demonstrate setting ad events on a interstitial,and show interstitial when load success:

 Admob.Instance().interstitialEventHandler += onInterstitialEvent;
 void onInterstitialEvent(string eventName, string msg)
 {
     Debug.Log("handler onAdmobEvent---" + eventName + "   " + msg);
     if (eventName == AdmobEvent.onAdLoaded)
     {
         Admob.Instance().showInterstitial();
     }
 }

You only need to register for the events you care about.

8.How to integrate Admob Rewarded Video to Unity3d app? Here is the minimal code to create an admob video.

 Admob.Instance().loadRewardedVideo("ca-app-pub-312xxxxxxxxxxxx/xxxxxxxx"); 

Simular with interstitial,video need to be explicitly shown at an appropriate stopping point in your app, check that the video is ready before showing it:

 if (Admob.Instance().isRewardedVideoReady()) {
   Admob.Instance().showRewardedVideo();
 }

9.Show Admob Advance Native Ad in IOS and Android App Here is the minimal code needed to show admob banner. This is implemented with Admob Native Advanced as AdMob announced stop the express format ads

 Admob.Instance().showNativeBannerRelative("native ad id",new AdSize(360,100), AdPosition.BOTTOM_CENTER, 0,"defaultNativeBanner");

The AdPosition class specifies where to place the banner. AdSize specifies witch size banner to show

10.Remove Admob Native Banner By default, banners are visible. To temporarily hide a banner, call:

 Admob.Instance().removeBanner("defaultNativeBanner");

Important Tips If you not config AndroidManifest.xml,APP will crash Attach admob to Object on scene,init admob before call admob fun Add GoogleService-Info.plist to your xcode project,otherwise,APP will crash Add Link Flag -ObjC to your xcode project,otherwise,APP will crash Unzip GoogleMobileAds.framework.zip to GoogleMobileAds.framework Edit res/values/string.xml and set the appid to your

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

263 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Input Dispatching issue ANR reports in Unity 3D Game on Android platform 0 Answers

SQL Unity Android 0 Answers

Send command to unity android application 0 Answers

mobile device restarts when game is uninstalled 0 Answers

how to define a user id securely 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges