UnityAds in iOS using wrong game id, and not working - ios

I am using UnityAds in my mobile game, to show a banner and a rewarded video.
In the editor and in Andorid works fine.
However for iOS it doesn't work, i took the logs and i noticed that for iOS is using my android gameid, this i have no idea where it comes from, i searched every file in my project, i never reference the android gameid, just the iOS one.
So it is clearing taking the id not from my initialization but from some sort of cache, anybody has an idea where is taking the gameid from? thanks
Btw
I am using Advertisement package from package manager.

You can open manually Project Folder\ProjectSettings\UnityConnectSettings.asset in text or code editor, then find
UnityAdsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_IosGameId: <---- THIS ONE
m_AndroidGameId:
m_GameIds: {}
m_GameId:
and edit it

Related

Xamarin iPad app never gets past default blue xamarin logo screen

(Microsoft Windows 10 VS2022)
I have a basic Xamarin App that I have been working with and deploying on my Android Phone. (works great on Android.)
I created a Apple Developer Account and added those details into Visual Studios 2022.
I plugged in an iPad and started debugging.
The app launches and Hot Reload at the bottom says Launch succeeded.
But the screen only shows the Blue default Xamarin page that initially loads as default. It never goes past that - I don't get any errors. And all my breakpoints set at all spots on the App.xaml.cs page and AppShell.xaml.cs page never get triggered.
Is it a navigation issue with my AppShell.xaml.cs?
Or what could I be missing? Where do I look to see where it is hanging?
public App()
{
MainPage = new AppShell();
}
public partial class AppShell : Xamarin.Forms.Shell
{
public AppShell()
{
InitializeComponent();
Routing.RegisterRoute(nameof(MainPage), typeof(MainPage));
}
}
It appears I may have found the solution.
I updated the iPad (only one revision back; it's at 15.4 now)… I don't think that was the issue.
I think I had not "Built" the app prior to debugging. This resulted in a bad version being stored on the iPad. (You must delete the app with each change.)
To help - If you have a Windows machine developing on Apple iOS:
When developing on a Windows (win) 10 machine. You have to do a full build First!
Build - Build Solution.
Then debug/deploy on apple device.
Every change made - you must delete the app off the Apple device, Build, and re-deploy. This is the only way I can get it to work.

Xamarin Forms error - 'You MUST call Xamarin.Forms.Init(); prior to using it' - TestFlight (iOS) only

I've seen several other posts on SO and elsewhere about this error (System.InvalidOperationException: You MUST call Xamarin.Forms.Init(); prior to using it. at Xamarin.Forms.Device.get_PlatformServices), but none of them shed any light on my particular situation.
I've created a Xamarin.Forms application that works great on Android (emulators and device, including when distributed through Google Play), and works fine both on the iPhone simulator and when provisioned to the iPhone. And when I say 'works fine', I mean 'is able to get to the MainPage without error.'
However, when I use Ad-Hoc deployment and upload it to Apple so it can be distributed with TestFlight, the TestFlight-downloaded version shows the splash screen as expected, and then crashes without ever showing the MainPage. In looking at the device logs, the above error appears, and in doing some Internet research, it's become apparent that my AppDelegate needs to have global::Xamarin.Forms.Forms.Init(); as the first line in the FinishedLaunching() method.
So I went to take a look and put that line in that method in that file, and lo and behold, it's already there. This is not unexpected, given the fact that the app works on the sim, and on the iPhone when deployed directly from Visual Studio.
So my question is 'Why does Ad-Hoc deployment fail when all other deployment types do not, and what can I do to overcome this problem and get the app to actually distribute through TestFlight in a runnable fashion?'
I was able to resolve the issue by putting the command (global::Xamarin.Forms.Forms.Init();) first thing in every constructor in every class in the iOS platform-specific services. It's possible that only one was really necessary, but it doesn't seem to have caused any issue to over-deploy that particular command, and in the case that more than one of the services is called before the AppDelegate's FinishedLaunching() method is called, that would seem to be necessary in the first one called, which could potentially vary by program flow, depending on environment and other variables that may be checked.
In .iOS project make sure the line
"global::Xamarin.Forms.Forms.Init();"
is the first line in the event
"public override bool FinishedLaunching(UIApplication app, NSDictionary options)"
in
"AppDelegate.cs" file.
In .UWP VB project make sure the line
"Xamarin.Forms.Forms.Init(e)"
is after the line
"AddHandler rootFrame.NavigationFailed, AddressOf OnNavigationFailed" in
"Protected Overrides Sub OnLaunched(e As Windows.ApplicationModel.Activation.LaunchActivatedEventArgs)" event
in "App.Xaml.vb" file.
In .Android project
"global::Xamarin.Forms.Forms.Init(this, savedInstanceState);"
is after the line
"base.OnCreate(savedInstanceState);"
in "protected override void OnCreate(Bundle savedInstanceState)" event.
Hope this helps.

appcelerator iOS application error with geolocation module

We are developing app for iOS and Android and we are using Ti.Gelocation to getCurrentPosition and then set the Region of the MapView of ti.map module.
The app is already on marketplace and downloaded, so we are developing an important upgrade with this new feature. We dont't have problem with Android platform, but with iOS version of the app we get a several error invoking Ti.Geolocation module
The error on iOS 9.x on iPad and iPhone (we have no test on iPod) is:
-[__NSCFString containsObject:] unrecognized selector sent to instance 0x1463d500 at GeoView.js (line xxxx)
This error happens with the project with it.vocami.vocamiapp app-id, in the test project (ap-id=it.vocami.vocamitest) that we use for research and test of new features, no error happens and all run good. When we add at every level of our code (in the first row too), for example, Ti.Geolocation.locationServiceEnabled, in the main vocamiapp project, we get the error.
We have tried all we could think but at the end, if we change the app-id, the code runs otherwise we get the error. We cannot change the app-id because we need to update our published app.
We are developing with AppceleratorStudio version 4.5.0.021602170281 and Ti SDK ver 5.2.0GA on Mac OS X 10.10.5.
I just recently was "hit" by the fact that when I made my app ready for Google Play I use a specific key/user to sign it with. That behaves differently from just running it locally on the phone.
I had to make sure that I had registered two certificates with Google's API in the developer console. It didn't give me exactly the message that you show - but wouldn't show the map with a location. And the way I read the location prior to showing it on the map led me in the wrong direction looking at permissions on Android first :-)
/John

BlackBerry advertising for Torch

I downloaded the advertising SDK and followed the directions in the development guide PDF that came with the SDK.
This is what my code looks like after setting all the config stuff step by step in the PDF:
Banner bannerAd = new Banner("my zone id #", null);
bannerAd.setMMASize(Banner.MMA_SIZE_EXTRA_LARGE);
add(bannerAd);
When I have just lines 1 and 2 nothing happens, but when I put in line 3 my simulator will not start and it also does not work on an actual device. I am not getting exceptions and do not see anything weird in the event log.
The simulator I am running is a BlackBerry Torch, so is the actual device, and the advertising SDK is for post6.0 devices.

PhoneGap + Sencha2 screen blank

I've started a project in PhoneGap which will utilise Sencha Touch 2.
I tried to change the app name from 'app', since I've heard that conflicts with PhoneGap on Android devices. I altered app.js to main.js and that worked, but then I tried changing the Ext.application.name. All I got was a white screen after the loading splash, even with the old name Sencha. Debug console shows nothing at all happening, and the document <body> was empty. This happens with both sencha-touch-all.js and sencha-touch-all-debug.js. Test device is an iPad 1G running iOS 4.3.5.
Aside: To debug this issue, I set up weinre on my Mac and added the appropriate <script> tag to index.html. After making that change, though, the app didn't even launch. It hung on the PhoneGap splash png and I got this message from gdb-remote:
error: failed to launch '<app URI>' -- failed to send the qLaunchSuccess packet
The only reference to that message besides its definition in gdb-remote source that I can find is here, and it's unrelated. I managed to get the issue to go away by restarting the iPad and removing build intermediates.
SOLVED: The issue here was a missing value in the Ext.application definition (key with no associated value), so the whole app definition probably tanked as a result of that. Hence blank screen.

Resources