AdMob not displaying on copied Swift project - swift

I have created an app in swift and it’s in the app store, displaying Google AdMobs interstitial.
Let’s call the app ‘MyApp’, and bundle identifier is ‘com.mrx.-MyApp’.
Now, I’ve made a copy of this app, it has the same name, and some minor modifications, and just changed the bundle identifier to ‘com.mrx.-MyAppTwo’. That’s it. The display name is still ‘MyApp’ (not ‘MyApp Two’) and the ‘Name’ (under ‘Identity and type’) is also still just ‘MyApp’.
No other changes in the projects settings (no renaming or anything, since the app’s name is the same).
I’ve create a new AdMobs using the app name ‘MyApp Two’ and the bundle identifier ‘com.mrx.-MyAppTwo’.
However, it will simply not display adds (it works fine with AdMob’s sample ads).
My guess is that it has something to do with the naming, but I can simply not figure it out.
Any help?
Thanks in advance.

Seems like just renaming it under 'Identity and Type' did the trick.

Related

Bundle Identifier Changed Core Data Lost

I changed a project from Objective-C to Swift and created a whole new project when I did this. I have an app in the AppStore and wanted to send an update instead of releasing a new app.
I understand that my Bundle Identifier needs to be the same when updating an app. When preparing the app for release, I changed my Bundle Identifier to match my app in the AppStore - since I started with a new project - and in the process my Core Data file seems to be missing. If I change my Bundle Identifier how do I keep access to Core Data?
This took me a while to figure out but here is how I fixed the issue.
Change your product name under Build Settings -> Packaging -> Product Name to the desired product name. This will change you Bundle Identifier to the desired name.
Clean your project by selecting Product -> Clean.
Select your CoreData model in the project navigator and then select the "Data Model Inspector" in the Inspector tab. Change the project name under class to the new class name. I got stuck here since I did not know Spaces, dashes, . are all replaced by underscores. You can see that my Product Name is FLO-Cycling and the CoreData class is FLO_Cycling.
If you have imported the Swift bridging header file anywhere make sure to update it.
I hope this can help someone.
Take care,
Jon

Create an App within an App

I am being presented with a very interesting project. The task that I must complete is to figure out a way to allow a partner to be involved in an app without giving up their source code. The code will be included in the main bundle of the app so it is not dynamically stored. The partner has a fully functional app that is needed to be ran in a window within the main app at the appropriate time. I know having the partners create a web app would be ideal so it is treated like a webpage but I am more concerned with codes that must be written natively in iOS.
My question is what is the best way to go about solving this? In theory it is like an App within an App. Is there a way if they gave up their .app file I can include this in the bundle and then run it when I catch a certain event? Should I have the partners create their code in a framework and then import into the shell project? What is the best way to approach this problem?
If your 2nd-party doesn't want to provide you with the source code, why doesn't he compile it to object code then let you simply link it to your app?
By the way, at least on official (non-jailbroken) iDevices, apps can't 'embed' or 'open' one another in such a way - you can open an app programmatically if 1. it's a separate app 2. it has a registered special URL associated to its bundle.
Is there a way if they gave up their .app file I can include this in
the bundle and then run it when I catch a certain event?
No, you'll want to have them create a library instead. You can then include that library in your project.
Creating a library is as simple as:
Choose File->New...->Project... in Xcode.
Select the "Cocoa Touch Static Library" project template.
Add your code.
Build.
The result is a static library that you can add to your application(s). The library will contain the compiled code that you added, but doesn't include the source code. The library developer should provide whatever header files are necessary to use the code in the library.
An App within an App is possible however it requires a common data framework that allows one app to reference the same data without confusing the the source of and destination of the data.
Such a framework allows one app to interact with another app referencing the same data.

one code base for iphone generic application?

I have built a generic application which can handle different content data - but for each content data, it will be a different iphone application (with a different name).
I would like of couse to only keep one code base for all these different apps (as it would be easier maintenance) but I have 2 questions:
1- I would need to change the appname in the buildsettings, etc.. and may be it is going to be an overkill...? especially with the upload process then...? What are your experiences in that domain and what would you recommend me to do?
2- how can I have all the pictures for logo (Icon.png, etc...) to co-exist into one app? For the moment, I have a global variable (as a singleton pattern) that I switch to change appname and loaded data inside the program
Thanks in advance for your help
Cheers,
geebee
You can do this pretty easily, it's what most developers do in their lite versions. All you have to do is add another target to create a new app out of the same code and use that global variable.
In order to change the images included in the app you simply edit the target and under the copy bundle resources menu remove the unnecessary resources. You'll notice that when you add a new resource you have the option to include it in any one or more of your targets. Simply select the one that you want and it will only be accessible to that target.
The reason that this works is that each target can have its very own info.plist. All the settings and resources can be separate, and the code can be different using your #ifdef global_var.
Here's a slightly outdated tutorial that should get you started if you need it.
http://www.bit-101.com/blog/?p=2098
For each application name add one target.
Create one xyz-info.plist for each of the target. (in this case for the xyz.app)
In each of the xyz-info.plist assign the appropriate icon files etc.
Within your build phases for each of the targets you will define which images go with which app.

How to share keychain data between iOS applications

I am describing a problem for which it took me quite some time to learn the answer.
The "GenericKeychain" example is a good start at providing a wrapper for sharing keychain data between applications when using the accessGroup in the init.
However, implementing this in my app yielded an obscure error code (which took forever to locate) -25243, which means: No access control.
I ran Apple's example app (GenericKeychain) on my iPad only to get the same error. Huh?
Does Apple's documentation fail to deliver on what is necessary to accomplish this?
After some (a lot of) digging throughout the web, I found the answer. The access Group that you use when constructing your KeychainItemWrapper class must ALSO be specified in each of your application's Entitlements.plist file in the "keychain-access-groups" section.
It seems almost obvious now that I see "keychain-access-groups". However, I had no idea to even look there. Hope this helps others.
Actually it's not hard to do. Please follow the steps.
App1:
Open your App's target Capabilities and enable KeyChain Sharing.
Add a identifier. (eg : com.example.sharedaccess)
Add "UICKeyChainStore" to your project.
Be sure you have a team id added to your App1 project.
Add Security.framework to your App1 project.
And add these codes to somewhere you need.
[UICKeyChainStore setString:#"someValue" forKey:#"someKey" service:#"someService"];
App2:
Open your App's target Capabilities and enable KeyChain Sharing.
Add a identifier. (eg : com.example.sharedaccess)
Add "UICKeyChainStore" to your project.
Be sure you have a team id added to your App2 project.
Add Security.framework to your App2 project.
And add these codes to somewhere you need.
NSString *string = [UICKeyChainStore stringForKey:#"someKey" service:#"someService"];
Your TeamIDs should be same for both projects.
I tried these steps on a real iPhone device.
I also tried these steps with Automatic and iOs Development provisioning profile.
My apps' bundle identifiers were like that : com.example.app1, com.example.app2.

iphone: appID creation problem?

Whenever I create an app ID on my provisioning profile, the 10 digit bundle seed ID keeps getting imported in front of it... e.g. YVW2UMA3HV.com.yourcompany.ytj
..As a result, the project i'm trying to compile (which as bundleID com.yourcompany.ytj gives an error in Application Loader.
..Is there a way to create an appID without the 'YVW2UMA3HV' in front of it ?
This is expected behavior and always worked for me.
Have you, however, tried using something different than "com.yourcompany" as prefix? Because that's where the problem might be at.
The value you supply in your Xcode project for the Identifier property of the target is just the com.yourcomparny.whatever portion of the AppID.