CTMessageCenter in iOS 9 and Above - ios

There once existed and may still exist a part of the private iOS API, in CoreTelephony, called CTMessageCenter, which was a class that could be used to programmatically send SMS.
I've struggled for a while now trying to figure out if it is possible to use this class on iOS 9, even going so far as to download these iOS runtime headers and attempt to include the framework in my project... it appears as empty after the import. In any case, CTMessageCenter seems to have vanished... surely it still exists or has an alternative.
I've tried using selectors, just importing CTMessageCenter.h, and probably other things I can't remember... any help with this would be appreciated.

Related

Retrieving finder comment of a file in iOS application

I am trying to use the finder comment field of a file stored in the folder of my iOS application (I'm talking about local storage, not in the cloud). The function MDItemCreate that would enable me to do so easily is not available in iOS applications apparently, which must be why the build currently fails with the error warning : "Cannot find 'MDItemCreate' in scope". Apple documentation in fact states that this method is only available on MacOS.
I have tinkered with FileManager but it doesn't grant access to comments.
This topic seems related but the solution is quite opaque to me.
My understanding of Swift is rather limited, if you would be so kind as to provide a simple and detailed answer I'd be much grateful.
With thanks,
Julien
I'm not completely certain, but messages like "Cannot find 'X' in scope" are often due to a forgotten import statement. MDItemCreate(_:_:) (docs) seems to be part of the Core Services framework, which has been part of iOS since iOS 12. Have you imported the framework?
You can do this (at the top of your .swift file) as follows:
import CoreServices

How to wrap existing iOS code in a new Appcelerator module?

This seems like a basic request, but I can't find the answer to it anywhere. I want to wrap some existing iOS code that I wrote, in a Appcelerator module. That's it. Important points:
I am NOT wrapping a pre-existing 3rd party iOS SDK.
I wrote the iOS code being wrapped.
Code is verified as working within xcode.
There are no .a files. There are 2x .h files and 2x .m files though.
There are no UI elements in the iOS code as it is only designed to connect the native bluetooth hardware to the app.
I have created a generic appcelerator iOS module project, built it, and successfully called the generic ID function within my app.
I cannot figure out how to successfully edit the generic module so that it utilizes my code. Every attempt results in it refusing to compile, and it's maddening.
I do not have access to Hyperloop.
Once I can successfully build the wrapped module, I would call an initialization function which triggers a native bluetooth hardware search. Once connected, there are functions within the module to send commands to the hardware and receive data back. This is the official documentation I've followed so far:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Quick_Start
That helped me build the blank module, include it in the app, and ensure that it worked by calling the built in test property. From there it stops short of actually telling me what I need to know. These are the closest things I've found so far, while still not being what I need:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Project-section-43288810_iOSModuleProject-AddaThird-PartyFramework
appcelerator module for existing ios project sdk
Heck, I still don't even know if I can do this within studio or if I have to edit the generic module in Xcode. Help! :) Many thanks in advance.
so first of all, this is not best practice and will cause possible problems in the future when the SDK changes and your module still relies on outdated core API's.
Regarding your question, you could either create a new component that subclasses the existing class, e.g.
class TiMyModuleListViewProxy : TiUiListViewProxy {
}
and call it with
var myList = MyModule.createListView();
or you write a category to extend the existing API with your own logic, e.g.
#interface TiUIListViewProxy (MyListView)
- (void)setSomethingElse:(id)value;
#end
#implementation TiUIListViewProxy (MyListView)
- (void)setSomethingElse:(id)value
{
// Set the value of "somethingElse" now
}
#end
I would prefer the second option since it matches a better Objective-C code-style, but please still be aware of the possible core-changes that might effect your implementation in the feature. Thanks!

How can I transform my iOS/Swift project to a state where I will be able to use live views?

I have been working on my first iOS/Swift application for the past month or so, and have created all of my class declaration files (i.e. my .Swift files) in my main project folder. I would really like to use live views in my app, because as of right now I cannot build/run the app at all due to errors I don't know how to fix (I'll be posting about those later today in hope of finding someone who can help me fix them).
What would be the best way to go about converting all of my views into embedded frameworks so that I could use the Live Views feature of Xcode ? I am running Xcode 7 and wrote my app in Swift 2.0
Thanks
You apparently don't need to use frameworks for that anymore. At least it works just fine in Xcode 7 for me - for classes that are part of the main project. Just mark your class as #IBDesignable.
But in order to show the preview, your code needs to be able compile, so you will need to resolve your issues first.

Creating an iOS library or framework using libgdx (roboVM)

Is it possible to create an iOS library or framework using libgdx (RoboVM) that can be imported into Xcode?
Background:
One of my colleagues has created a 3D visualisation app as a libgdx project for android and windows desktop. It can be compiled to run on iOS using RoboVM. However, I would like to wrap extra native user interface elements around it using Xcode. I know its possible to build the user interface programmatically via RoboVM but I would be keen to investigate if its possible to bring the existing work into Xcode. I don't need to edit the 3D visualisation component but add extra GUI elements around the 3D Vis window. I thought compiling the libgdx (RoboVM) code to a framework or library might be a solution that could be imported?!
Yes you can do it.
All you need to create a method, say initRoboVM(), This will be called by your code when you want to initialize libgdx. You'll need to pass the app path in, which you can hardcode when you're testing.
initRoboVM() will need some modifications, namely it should not call your Java app's main method, well, at least, that's what well behaving libraries should not do IMO. It should also not call rvmShutdown.
You can get further information from here
Thanks :)
I asked the RoboVM team directly. Their answer: It's not a native function, but it certainly can be done.
The complete message...
Hi,
Sorry for the late reply. This use case is not something we're going
to do now. It is possible though if you're prepared to do some
patching of RoboVM. Search the RoboVM Google Group and you should find
others who have managed to get this working.
We get this request every know and then so we will add support for
this eventually.
Regards, Niklas

iOS How to use private API?

I don't want to submit this app to AppStore. I've tried for many times but met so many problems :(
I use class-dump to get all the header files of UIKit.framework. In the UIApplication.h generated by class-dump, I saw the method I want to use----launchApplicationWithIdentifier.
Then I put UIApplication.h in my project and import it. Compile, I got a lot of "Redefinition of enumerator...." error because in the UIKit.framework I use previous, there's another UIApplication.h. But this file doesn't have the method launchApplicationWithIdentifier.
If I delete the previous UIKit.framework and import the folder generated by class-dump. Then it appears like a framework but if I unfold it, it's empty.
Then I want to make all generated header files a framework file ant replace the previous UIKit.framework. But I don't know how. As we can see, under the system framework directory, there's a file which has the same name as the framework and has a 'executed shell script' icon. How can I made this file?
I really got confused. Someone can give me a hand? Thank you.
Just specify the private methods in a category interface above the class implementation where you want to use it, like this:
#interface UIApplication (Private)
- (BOOL)launchApplicationWithIdentifier:(id)identifier suspended:(BOOL)suspended;
#end
Don't import the whole class-dump file and link with the original UIKit framework.
You must be very careful when using private API. These methods can change or be removed in future iOS versions!
Check if the method really exists with respondsToSelector: at runtime and be prepared for the case that it does not exist.
I used a secret MapKit feature in my own application and I knew that the private methods only exist in iOS 5. So my app still works in all iOS versions but this feature is only available in iOS 5 (Apple removed or changed it in iOS 6 beta 1).

Resources