• peterdougstuart

    For those of you on Twitter it would be great if you could follow @mapmangame. We are working up to our release and it would be great to build up a bit of a following before we go live. thanks!

    posted in Pythonista read more
  • peterdougstuart

    Hi

    Pleased to say that I got my first iOS app approved last night which was written on Pythonista. The app called MapMan is a puzzle game which is free to download with an optional in app purchase.

    I am planning a release in the next 1-2 weeks. I’ll post again when it’s live. I owe a lot of thanks to the Pythonista forum for helping me out which many challenges I faced along the way, thanks everyone! and of course thanks to OMZ for the wonderful Pythonista (and Pythonista App template).

    More details here http://mapmangame.com

    P.S. if anyone has any suggestions about how I can spread the word about MapMan please let me know.

    posted in Pythonista read more
  • peterdougstuart

    Hi @xino386 can you PM on twitter and I’ll send you a zip of my scripts (same handle as here). Note that my scripts have been trimmed down to match the subset of the libraries used in my app so you might be better off following the steps above to get it to work.

    posted in Pythonista read more
  • peterdougstuart

    Sorry for delay responding....

    Happy to share @RomSpy, but please note that my templates have been minimized to my project i.e. deleted lots of modules I'm not using. Therefore it may not work for your project. You might be better off following the principles of steps I outlined above.

    If you are still interested in my templates can you send me a PM on twitter (same handle as here) and I'll send you a zip or something. Alternatively point me to somewhere I can upload the files and I'll do so.

    posted in Pythonista read more
  • peterdougstuart

    I'm making a bit of progress:

    • My original error related to the future.py file in pylib, after running the script the Xcode error changed.
    • I noticed that after running the above script the specific file that I was getting the 'Invalid Signature' error on had change to pylib/compiler/init.py. I had a look at that file and it didn't have a #\input texinfo up the top so I added it manually.
    • I then reran the script and the error changed to pylib/compiler/ast.py This did have lots of #\input texinfo, so I copy and pasted all of them to double the amount of #\input texinfo lines at the top of the file. This seemed to satisfy Xcode.
    • I then reran the script and the error changed one of the files in pylib/ctypes/test. I just deleted the whole pylib/ctypes/test folder.
    • I than reran the script and the error changed to pylib/dateutil/READEME. I deleted the README file and the NEWS file while I was at it.
    • I than reran the script and the error changes to pylib/site-packages/dropbox/init.py. As I'm not using dropbox in my app I just deleted the dropbox folder.
    • I then had errors on pylib/site-packages/twitter.py, webbrowser.py, xmltodict.py and ui.py. They all had just one #\input texinfo line so I inserted an extra 1000 #\input texinfo lines at the top of each.
    • I then had remaining errors in the files in pylib_ext/ so I added about #\input texinfo lines at the top of each.
    • Finally my app submitted successfully!!!!

    I must confess I really don't understand all of this. Feels like there's got to be a better way....

    Thanks to @sreyemnayr for posting the script as I would not have solved this without it.

    posted in Pythonista read more
  • peterdougstuart

    Hi @sreyemnayr, just tried your script, but still getting an error on upload to app store. Any other ideas or refinements to your script?

    posted in Pythonista read more
  • peterdougstuart

    OK got this sorted. After rolling back the requests and DropBox updates (latest versions) I installed the specific version that synchronator quoted as the minimum using stash

    pip install ‘dropbox==7.2.1‘

    Now everything works! Thanks everyone.

    posted in Pythonista read more
  • peterdougstuart

    Ok so I realised when you pip in pythonista with stash it puts the modules under ‘Modules & Templates/Site-Packages’ which overrides the modules in the ‘Modules & Templates/standard library (x.x)’. I deleted the newly download requests, DropBox Etc from there and I’m back to where I started.

    It seems like there is currently some issue with the latest version DropBox and Request packages. Synchronator needs an updated version of these libraries, but currently they are not working.

    Does anyone have any other ideas?

    posted in Pythonista read more
  • peterdougstuart

    Hi

    I’m managed to install stash and attempted to update requests as per the readme in Synchonator and am now getting the following error, anyone know how I fix this?

    /private/var/mobile/Containers/Shared/AppGroup/C0C8A414-409D-4540-878C-0DDC5320C51A/Pythonista3/Documents/site-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.4) or chardet (3.0.4) doesn't match a supported version!
    RequestsDependencyWarning)
    stash: <type 'exceptions.ImportError'>: cannot import name DependencyWarning

    posted in Pythonista read more
  • peterdougstuart

    That's great, I'll give it a go.

    posted in Pythonista read more
  • peterdougstuart

    Hi

    Just ran my usual DropBox sync script in Pythonista and got a 400 v1_retired error!

    Anyone got this? It looks like the Drop V1 API has been deprecated for a while and they finally pulled the plug.

    Is this going to take a Pythonista release to fix?

    posted in Pythonista read more
  • peterdougstuart

    Many thanks that's done it. I was a bit thrown by the syntax of how an objective-c delegate maps to the python method, but I think I get it now. I know precious little objective-c which isn't helping!

    Thanks again.

    posted in Pythonista read more
  • peterdougstuart

    Hi

    I'm trying to get some objc_util code working that involves a delegate, however I just can't seem to find the right syntax for expressing the delegate method.

    Can anyone help? Code is below and the delegate I'm targeting is defined here:
    https://developer.apple.com/documentation/storekit/skproductsrequestdelegate/1506070-productsrequest

    I'm marshalling access to the objc_util code through a singleton which is initiated within the app using InApp. initialize()

    BTW the code is running in the AppTemplate in Xcode.

    Thanks!

    from objc_util import *
    
    def PurchaseController_fetchAvailableProducts(_self, _cmd):
    
        obj = ObjCInstance(_self)
        
        sk_class = ObjCClass("SKProductsRequest")
        products_request = sk_class.alloc().init(productIdentifiers=[InApp.PRODUCT_ID])
        
        products_request.delegate = obj
        products_request.start()
    
    def PurchaseController_canMakePurchases(_self, _cmd):
        sk_class = ObjCClass("SKProductsRequest")
        return sk_class.canMakePayments()
    
    def PurchaseController_purchase(_self, _cmd):
        pass
    
    def PurchaseController_purchaseMyProduct(_self, _cmd):
        pass
    
    def productsRequest_request_didReceiveResponse(_self, _cmd, request, response):
        #defined here: https://developer.apple.com/documentation/storekit/skproductsrequestdelegate/1506070-productsrequest
        InApp.receive_products(response)
    
    class InApp:
    
        PRODUCT_ID = "Purchase001"
        Instance = None
        
        @classmethod
        def initialize(cls):
            cls.Instance = InApp()
    
        @classmethod
        def receive_products(cls, response):
            cls.Instance.products_received = True
            self.products = ['Dummy1', 'Dummy2']
        
        def __init__(self):
            
            self.products = []
            self.products_received = False
            
            ObjCClass('NSBundle').bundleWithPath_('/System/Library/Frameworks/StoreKit.framework').load()
            
            superclass = ObjCClass("NSObject")
            
            methods = [PurchaseController_fetchAvailableProducts,
                       PurchaseController_canMakePurchases,
                       productsRequest_request_didReceiveResponse]
            
            protocols = ['SKProductsRequestDelegate', 'SKPaymentTransactionObserver']
            
            purchase_controller_class = create_objc_class('PurchaseController', superclass, methods=methods, protocols=protocols)
    
            purchase_controller = purchase_controller_class.alloc().init()
    

    posted in Pythonista read more
  • peterdougstuart

    Just to give this a little bump...the issue seems to happen when I use anything other than the basic fonts e.g. if I use Courier or Arial they appear fine in both the Pythonista an the Xcode App, however as soon as I user anything like 'Arial Bold' or 'Arial Rounded' it will show up fine in the Pythonista App, but appears tiny in the Xcode app. seems like somehow the Xcode template doesn't support the font variants. Any ideas?

    posted in Pythonista read more
  • peterdougstuart

    Yes, I am indeed using the XCode App Template (probably should have said this in the first placE). This thread discussing integrating Ads, but not in-app purchases. It also indicates objc_util is the way to go. I'll do a bit of research

    posted in Pythonista read more
  • peterdougstuart

    Hi

    I'm close to releasing a puzzle game in the App store created using Pythonista. My testers are giving me feedback to go for in-app purchasing over a paid app. Is this possible in Pythonista, I'm not sure where to start? Any advice, hints or tips would be greatly appreciated.

    Thanks!

    posted in Pythonista read more
  • peterdougstuart

    Hi

    I'm using the Pythonista App template to build an app. My designer friend has specified the Arial Rounded font which shows up just fine when running within the Pythonista App. However aftering building the App in xcode using the Pythonista App Template the text appears as tiny text i.e. it has a very small font size (much small than that sepcificied). I'm using a LabeNode to display the text.

    Does anybody have any idea what's goign on? Thanks in advance.

    posted in Pythonista read more
  • peterdougstuart

    Thanks, I followed your advice and I now have managed to submit to Test Flight for testing. Many thanks for your help.

    posted in Pythonista read more
  • peterdougstuart

    Hi

    I'm using the Pythonista App Template (https://github.com/omz/PythonistaAppTemplate) to prepare my App for submission to the App store.

    It all builds fine, but after I submit to iTunes connect (from Xcode) I receive the following

    *Dear developer,

    We have discovered one or more issues with your recent delivery for "MapMan". To process your delivery, the following issues must be corrected:

    Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.

    Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

    Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

    Once these issues have been corrected, you can then redeliver the corrected binary.

    Regards,

    The App Store team*

    What's confusing is the fact that Pythonista App is not using the iOS calendar, photo library or bluetooth, so these seem like false positives. I want to provide some meaningful text for the descriptions, but I'm not sure what to write as I'm not really using these privacy sensitive items.

    Has anyone seem this? Know why it's happening? And can offer any advice what I should do?

    This is one last hurdle to I finally get my app released so any advice would be greatly appreciated.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!