I would like to receive remote push notification when the app is on the foreground. I think I can use "didReceiveRemoteNotification" in Objective-C, but how about in Titanium? I've been searching solutions but can't find anything. Does anybody help me out?
Titanium currently only supports local notifications (by default) I believe. You might want to take a look at AppCelerator as a solution.
Sorry, i was wrong last time. It's very hard to find but Titanium supports a way of interacting with PushNotifications.
Please take a look at Ti.Network.registerForPushNotifications. It provides a callback that is executed when you receive a Push Notification.
The other posted solutions below may provide a better integration for titanium so it's up to you what you want to use. But this should answer your original question.
Unfortunately Titanium only supports local notifications on iOS. If
you want to support remote notifications you can use
Urban Airship
ACS (Appcelerator Cloud Services) or
you write your own module that provides "didReceiveRemoteNotifcation" as an app event to your app
As far as i know you can only listen on local notifications by
default but you can try this method if it reacts on remote
notifications..
Related
I published an app to the App Store using Titanium Studio in 2013. I have recently found a bug in the code that I want to fix and publish.
I logged into Appcelerator's website to download the latest studio since it's been three years, only to find out that it's a paid platform now.
I just want to make a quick bug fix and publish. I don't need any of the services that come with the platform.
I realize there is a free SDK that you can compile yourself, etc, etc.
I don't mind paying for a $36 for one month only if it enables me to just publish a new version of my app.
My question is, if I publish the app after paying the $36 and then cancel my subscription, will the cancellation affect my app? Does the IDE inject some sort of "call home" time bomb?
I tried asking the support at appcelerator but they answered like a politician and dodged it.
Thanks for any help.
A published/compiled app has no direct connection with appcelerator. So if you cancel the subscription nothing happens.
However, if you use paid services... things might go wrong.
Statistics for example is a paid service. If you cancel subscription I assume the app keeps working but will make calls to their backend that most likely will fail (not sure about this). App should keep working.
If you use any cloud service (push notifications, arrow storage etc) your app will stop working of course.
If you don't use any of the services, you can just cancel and be done with it.
That said, if you just want to make 1 change to an app you could just dive in and compile without the Appcelerator Platform and just use the Open Source code.
My React Native App crashed on a tester's phone.
What is the best way to get logs of that crash? I'm using React Native 0.14.2
We just rolled out official support for react native error reporting with Bugsnag this week which reports both JavaScript and native (Java/Cocoa) layer errors to a single dashboard.
Compared to Fabric - Bugsnag adds support for js source maps, ios symbolication, and android proguard mapping - which make a big difference.
Let me know if you have any questions or I can help in any way - I'm a founder.
As #Abhishek has commented, you'll have to use some monitoring tools with crashlytics to get such infomation.
Fabric is a good option in this case. It comes with a crashlytics solution.
Here is a blogpost that explains in-depth on how to set it up for your app.
Here's an excerpt of features of crashlytics tool of Fabric from the blogpost
Crash Reporting —It will record every single crash and its stack trace. This is way better than the iTunes Connect crash reports, which only include the info of users that opted in to share information with developers while setting up a new iPhone. It’s also not updated in real-time (you can read more about this here).
Crash Logs — (A.K.A. CLS_LOG) If you’re familiar with Objective-C, you have probably been using “NSLog” while you’re developing your app. You should use CLS_LOG instead. There’s no difference at all when you’re debugging (whatever you’re logging will still show up in the console) but the cool part is that when a user crashes your app, all the information will be sent to Crashlytics’s servers the next time the user launches your app, including all the content that you’ve logged through CLS_LOG. So if you log information for most of the actions/events in your app, you can read the logs later and reproducing the crash should be simple.
A good crash log framework that reports from the javascript level I've tried recently is Sentry. More descriptive with the actual error, if it comes from he JS side.
I wrote expo-error-log as a free alternative to BugSnag, etc.
Check it out if you like :
https://github.com/marchingband/expo-error-log
https://www.npmjs.com/package/expo-error-log
https://medium.com/#andymarch/free-error-reporting-in-expo-apps-with-expo-error-log-819cab5b6062
It seems like Crashlytics does the error reporting job perfect for a native app made in android/ios.
For a react-native app, however, Bugsnag looks more promising. You can explore both and see which one fits your requirements.
I'm working on a Windows app and integrated Toast notification in it. Paired with an AWS SNS service, it's working fine, I can successfully receive my notifications.
My notifications are used to fire events when the app is launched, it's not designed for final user. For this reason, I don't need any banner or display for these notifications: only handle the event in the app.
My issue is, when the app is killed, Windows displays a banner (top right corner) for any new notification. I found a way to disable banners directly in the OS, but I would like a solution when pushing the notification (backend side).
I already did it for iOS, kind of 'silent' notification, without any alert, sound or badge, but can still be handled by the OS.
I would like to know if there is any way to do that on Windows too? Like any extra arguments I missed or a dedicated template for that.
Thanks
I finally found a way to do that.
I changed from Toast notification to Raw notification (a push notification that does not involve UI). (MSDN - Documentation)
After that, I had to customise my AWS SNS notification wiht MessageAttributes to change the type of my WNS notification (AWS - Documentation).
I've also noticed that we can directly suppress the Toast UI on Windows phone with "X-WNS-SuppressPopup" param, which can be also very helpful. (MSDN - SuppressPopup).
Finally, inspired from AWS Baidu Push notification sample code, I did the same for WNS platform, adding all new arguments I needed, and it works great at the end.
Hope this can help someone else.
I am working on a Finder Sync Extension for OS X and want to use a background XPC service.
I can start in the main app and have it launch the XPC and run correctly but nothing happens when I attempt to access it from the Finder Sync. both the finder sync and the XPC are their own bundles so that may be the reason why. What I am wanting is for the finder sync to talk to the XPC about the status of the files and the main app to talk to both the finder sync and XPC about the list of folders to watch.
Has anyone had any luck with this? Is there a better way for a on demand background service? Is it possible to talk between two XPC services?
Working with some Apple Engineers they realized this was a problem and suggested using a LoginItem until a better solution is in place.
So, it is sort of an XPC service, just one that constantly runs. XPC communication is available to both extension and host app.
It works, although it is not the most ideal solution. I recommend the apple sample project that deals with XPC login items for an example of how to get this working.
I implemented MainApp <-> FinderSyncExtension communication via CFMessagePorts. See my question and answer for some details:
How should Finder Sync Extension and Main App communicate?
You can't communicate directly between the container application and the extension, but you can do it indirectly using shared resources. I did exactly what you have done which is completely incorrect. I hope you store the file status in the database, if not store it and then share the database between the container application and the extension. I know, why do you want to use XPCService as it is in the Apple's FinderSync Doc. (Actually for the performance reason, Create a NSXPCService to the extension and from the XPCService, access the shared database)
For more information about sharing database:
http://blog.sam-oakley.co.uk/post/92323630293/sharing-core-data-between-app-and-extension-in-ios-8
Hope this helps you,
I had stubbornly ignored utahwithak's answer and tried to get it to work anyway. I eventually had to ask a similar question on Apple Developer Forums and finally received a definitive answer on why connecting the Finder Sync Extension to an embedded XPC service is not a viable system design.
Essentially:
Finder Sync Extension essentially behaves like a third party app in that it does not have the same scope as the host app to be able to establish an XPC connection with the embedded XPC service.
utahwithak's answer is correct in that in order to allow the Finder Sync Extension to communicate with the XPC service, it needs to be an XPC login item. However there are some caveats to this:
This seems to be an accidental feature. Not sure if it's something that might eventually be fixed/removed
The XPC will have to be always running even if it doesn't need to, by virtue of being an login item
If it's a login item, the user will need to explicitly opt in for this feature and be able to opt out.
Source:
Establishing an NSXPCConnection from a Finder Sync Extension to an XPC Service
I've been searching all over the web and have found solutions to mounted device detection from within a Cocoa App using the NSWorkspace notification system. However this notification doesn't seem to be triggered when an Apple device is docked.
I specifically want my OSX App to detect docked iPads/iPhones, be able asses whether the iOS version of my App is installed and then synchronise files. I realise that the easiest way to do this is using iCloud, but I do not as yet have a developer membership with Apple and would like the option to be able to synchronise files without the internet.
An iTunes like system would be ideal. Any ideas.
Thanks in advance.
Apple don't provide any official APIs for doing what you ask.
Unofficially, you can try the stuff here: https://bitbucket.org/tristero/ipodaccessframework
You can definitely use it to determine whether a particular app is installed (by looking for a match for its bundle-id) and you can read/write files to/fro a particular apps document directory.
Disclaimer: this one is mine. There are definitely other libraries around that achieve similar results.