New mobile app (Android, iOS, Windows), plus 7 new integrations!

Nectar mobile app (Android, iOS, Windows) for Beeminder

As can be seen from the table below (click to enlarge), the Nectar mobile app includes almost all the features of Beeminder’s Android and iOS apps, as well as many additional ones including voice commands, goal sharing, the ability to add Beeminder and integration goals. You can add datapoints using only your voice (see below)! In addition, Nectar supports the Universal Windows Platform, including all 600 million Windows 10 devices.

Nectar vs Beeminder apps Comparison
[

Instructions to install Nectar

Use package (recommended):

Android

Requires Android 4.4 (KitKat) or greater.

Download: android-release.apk

To install the Android app, download it from an Android device, allow installation of apps from “Unknown sources” in :gear: Settings > Security and install the app by opening the .apk file.

iOS (iPhone/iPad)

Requires iOS 8 or greater.

If you want to install the iOS app, you will need to follow the instructions to build it: https://github.com/beeminder-capstone/Nectar-Frontend#build and (do before step 11) iOS Platform Guide - Apache Cordova. See note below under Developers.

Universal Windows Platform

Requires Windows 10.

Download: Windows.zip

To install the Windows app on a PC, enable “Sideload apps” or “Developer mode” in :gear: Settings > Update & Security > For developers, download and extract the file from a Windows 10 PC, open the folder corresponding to your system architecture (here are instructions to determine your architecture: https://support.microsoft.com/en-us/help/13443/windows-which-operating-system), right click the Add-AppDevPackage.ps1 file, select “Run with PowerShell” and follow the prompts to install the app.

To install the Windows app on a phone, enable “Sideload apps” or “Developer mode” in :gear: Settings > Update & Security > For developers, download the folder corresponding to your system architecture from a Windows 10 Mobile device, import the security certificate by opening the .cer file and install the app by opening the .appx file.

Build it

Nectar mobile app source code: https://github.com/beeminder-capstone/Nectar-Frontend.

Developers

Here are the instructions on how to build the Nectar mobile app: https://github.com/beeminder-capstone/Nectar-Frontend#build. Note: you will also have to follow the instructions below to run the Nectar web app locally, if you want integrations to work. Be sure to update your SECRET_KEY environment variable to the same value as the SECRET_KEY_BASE environment variable on the Nectar web app. In addition, update your DOMAIN_NAME environment variable to the internal IP address of the computer on your local network and port that the Nectar web app is running on (such as: http://192.168.0.2:3000). Most home routers allow static internal IP addresses to be assigned via DHCP reservation (see your routers user guide for more info). The redirect/callback URL for Beeminder OAuth is: http://localhost/callback.

I do not own a Mac, so I cannot build the production iOS package: https://ionicframework.com/docs/intro/deploying/#ios-devices. If anyone would be willing to do so and share the package on this thread so other iOS users do not have to build it themselves, please send me a PM.


To use the voice commands feature in the app: press the microphone icon and say, “Create goal” to go to the add goal page or say, “Add [number] to [goal]” to add a datapoint with value [number] to your Beeminder goal with slug [goal]. If the goal’s slug is not a word, try spelling it out.

Developers

Note: Voice commands are not yet supported on the Windows platform. If you are a developer and would like to add support for speech recognition in Windows, see these links: GitHub - pbakondy/cordova-plugin-speechrecognition: Cordova Plugin for Speech Recognition and https://docs.microsoft.com/en-us/windows/uwp/input-and-devices/speech-recognition.

Local notifications and native integrations are the only features the Nectar mobile app does not include, because Ionic does not yet support a background worker for the Windows platform. If you are a developer and would like to add support for a background worker, see these links: GitHub - transistorsoft/cordova-plugin-background-fetch: Implements background fetching of data. and Compare platform features between iOS, Android, and Windows 10. - UWP applications | Microsoft Docs. Alternatively, it would be easy for Beeminder to configure Nectar with their existing push notification system for all three platforms and users would receive alerts faster than with local notifications: Push - Ionic Documentation.

7 new integrations

Nectar web and mobile apps

The Nectar web app is a significantly improved version of @galtsubery’s Beemind.me/Quantifier app: https://beemindernectar.herokuapp.com. It automatically gets data from supported integrations every hour at about 50 min and adds it to Beeminder goals. The Nectar web app includes many changes including support for (the highly requested feature of) adding more than one instance of a metric and support for adding integration goals from the Nectar mobile app. The Nectar web app includes new Facebook, Instagram, Twitter, Flickr, Wikipedia and World Community Grid integrations and it supports beemind.me’s eight original integrations.

To try out these six new integrations, either visit: https://beemindernectar.herokuapp.com or follow the instructions above to install the Nectar mobile app. Note: these integrations are for testing only and should not be used in Beeminder goals where money is at stake.

Nectar web app source code: https://github.com/beeminder-capstone/Nectar-Backend.

The Nectar web and mobile apps support a total of 32 integrations providers and provides a framework in which developers can easily add new metrics by just adding one file and modifying another (see steps below under Developers). The rest of the integration providers do not yet have metrics.

Developers

Here are the instructions on how to run the Nectar web app locally: https://github.com/beeminder-capstone/Nectar-Backend#build. This can easily be run on the Raspberry Pi hardware. If you are installing on Linux, see these lines for an idea of which packages are required in addition to Ruby based on your package manager: apt, yum or pacman (Note that SQLite is not required). The format for the OAuth redirect/callback URL is http://localhost:3000/auth/[provider]/callback, where [provider] is from this line: Nectar-Backend/providers.rb at develop · beeminder-capstone/Nectar-Backend · GitHub.

Steps to add a new metric for one of the 32 integrations providers:

  1. If the provider uses OAuth, make sure you have a “key” and “secret” and it is in the respective environment variables listed in your .env.local file.
  2. If this is the first metric for the provider:
    1. If the provider uses OAuth, uncomment out the provider gem in the Gemfile and run: bundle install.
    2. Create an empty metrics folder for the provider: \app\metrics\[provider].
    3. Run bin/rails server (on Windows run: ruby bin\rails server). Then go to: http://localhost:3000/ and make sure it loads.
    4. If the provider uses OAuth, add a client function to the providers adapter file (\app\adapters\[provider]_adapter.rb). Go to: https://rubygems.org/, enter the provider gems name, click on the first result, then click on either “Homepage” or “Documentation” on the bottom right for instructions on what is necessary to do this.
  3. Create a ruby file for each metric ( \app\metrics\[provider]\[metric_name].rb). Add functions to the adapter file to get data. Use the existing metric and adapter files as reference. Consult the provider gem info (above) and the provider’s API for documentation.

Thanks to @galtsubery for creating the Quantifier app, (Nectar would not be possible without it) and thanks to Beeminder (@dreev and @bee) for paying to have the Nectar web app hosted on Heroku.

Beeminder Watchapp for Pebble

The watchapp automatically gets Pebble Health data from your Pebble Smartwatch every night at 11:59PM and adds it to one of your Beeminder Goals.

Instructions to install the Beeminder watchapp

The watchapp supports the Pebble Time, Pebble Time Steel, Pebble Time Round, Pebble 2 and Pebble Time 2 (Basalt, Chalk, Diorite and Emery hardware platforms). It will not work with the Pebble Classic and Pebble Steel (Aplite hardware platform) because they do not support Pebble Health.

Use package (recommended):

Download: Beeminder.pbw

To install the watchapp, download it from your mobile device and install the watchapp by opening the .pbw file (for iOS use “Open In…” and select the Pebble app). Note: this integration is for testing only and should not be used in Beeminder goals where money is at stake.

Build it

Beeminder watchapp for Pebble source code: https://github.com/beeminder-capstone/pebble.

Developers

Here are the instructions on how to build the Beeminder watchapp:

  1. Go to https://cloudpebble.net/.
  2. Click on “Import” > “Import From GitHub”.
  3. Give the project a name (such as “Beeminder”) and enter the GitHub URL (https://github.com/beeminder-capstone/pebble).
  4. Click “Compilation” > “Run Build”.
  5. To run it on a physical Pebble, click on “Phone” > “Install and Run” and make sure that the “Developer Mode” is enabled in the Pebble app.
  6. Or, to run it on an emulator, click any of “Basalt”, “Chalk”, “Diorite” or “Emery” to start the respective emulator (see the difference here: https://developer.pebble.com/guides/tools-and-resources/hardware-information/). Note: the config page will not work with the emulator because of the Beeminder OAuth.

If you want to send the data every hour, change this line: pebble/background.c at master · beeminder-capstone/pebble · GitHub to this:

if(settings.config && tick_time->tm_min == 59 && step_data_is_available())

and change lines 350-355: pebble/main.c at master · beeminder-capstone/pebble · GitHub to this:

int count = (int)health_service_sum(settings.metric, now - SECONDS_PER_HOUR, now);
if(settings.healthmetric == 2 || settings.healthmetric == 3)
count /= 60;

if(s_js_ready)
sendgoal(now, count);
else
savegoal(now, count);

Note that the watchapp must be opened to send data, closing your selected watchface, which is why I elected to only send data once a day.

:honeybee: :honeybee:

We would love everyone’s feedback and let me know if you have any questions.

Please visit tealdulcet.com to support this and my other software development.

Post written by: @tdulcet
Nectar remade and maintained by: @tdulcet
Nectar originally (Nov 2016 - Mar 2017) made by: @rnj, @tdulcet and others
Beeminder Watchapp for Pebble made and maintained by: @tdulcet

Copyright © 2017 The PSU CS Beeminder Capstone Team

6 Likes

Looks like impressive work. Any plans on adding the iOS app on the AppStore?

Some problems with the integrations:

  1. Tried out the Google+ integration but can not login at all, I get an error message before even seeing the login form
  2. On the Facebook integration and I get a 99734 value for the post count. This sounds quite excessive (I dont think i post that much!) is there a way to verify this?
  3. On the Instagram integration the follows count matches the number of accounts that I follow. I would guess most people want to beemind the number of followers they have

thank you in advance for checking on any of this!

1 Like

@apolyton Thanks for your feedback!

There is a note about that if you click on the first “Developers”, but yes, I would like to provide a package here for people to install. Unfortunately, I can not upload it to the AppStore because it costs $99 a year.

It currently includes metrics for just the six (Facebook, Instagram, Twitter, Flickr, Wikipedia and World Community Grid) integrations. Nectar is a framework in which developers can easily add new metrics to any of the 32 integration providers. The rest of the integration providers do not yet have metrics.

That is odd. If your comfortable using the Interactive Ruby Shell, I can provide steps to get a list of those posts.

That could definitely be added as a new metric. Pull requests welcome!

Let me know if you have any more questions.

2 Likes

Thank you for the quick answer!

Maybe the homepage should differentiate the providers that are actually functional now over the ones that don’t

1 Like

@apolyton The Facebook integration User Posts metric should now work correctly.

2 Likes

Teal, thank you so much for the amazing work here! I’ve installed the Android apk and am collecting feedback and bug reports and ideas. Do you like GitHub Issues for such things?

Thanks again for all the work on this! And thanks to @apolyton for trying it out right away. I hope others do too!

3 Likes

Daniel,

GitHub issues would be great. Thanks for trying it out. I will look forward to your feedback.

I made some small changes to the Nectar mobile app. It should now open faster and I added a new option when creating and editing Beeminder goals.

1 Like

Thanks to everyone who has installed and helped us test Nectar! We are working on publishing the Nectar mobile app to the Google Play and Windows app stores. We would also like to publish it to the App Store, if anyone (Beeminder?) would be willing to let us use their Apple Developer account.

In addition, we are looking for a Beeminder power user who would like to have their goals featured. As part of our submission to the app stores, we must have a lot of screenshots of the app and we are looking for a Beeminder user who has many goals of different types (hustler, fatloser, gainer…), different data sources and different statuses (green, orange, red, blue, won, lost…) who would be willing to let us use their account. Please send me a PM if you are interested.

I don’t mean to be a downer, and would definitely like something a bit more capable than the Beeminder Android app, but may I ask why it doesn’t support literally the most important feature for a mobile app (notifications)? I don’t really want to use two apps.

@kenoubi There is a note about that in the second paragraph, if you click on the second “Developers”, but yes, I would to include notifications in the Nectar mobile app. Beeminder uses a private API in their Android/iOS apps to support push notifications that I do not (yet) have access to.


@dreev and @bee Looking at the code from the open source version of your iOS app, it seems these are the API endpoints to subscribe to: https://www.beeminder.com/api/private/device_tokens.json?access_token=[access_token]&device_token=[device_token]
and unsubscribe from: https://www.beeminder.com/api/private/device_tokens/[device_token].json?_method=DELETE
push notifications. Are these correct and may we use them in the Nectar mobile app?

Permissions to send notifications are typically granted and controlled on a per-app basis, so probably Nectar should request permission and send its own push notifications in-app.

Once the app has permission and tokens etc to send notifications, if it wants to implement notifications on the zeno schedule, it could use the zeno webhook urls – http://api.beeminder.com/#webhooks – to get a zeno notification from beeminder, and then push through to the app user if they’ve allowed notifications. Hmm. Though at the moment there’s not a way to set the through the api, and those are designed more for the user themself if they want to set something up – since there’s only one per goal.

Oh wait! If you want to follow the zeno notification timing, you can send notifications after/from your autofetch_callback_url response. That callback is us checking for new data / fetching data on the zeno schedule for the goal.

1 Like

@bee Thanks for your response. We would like to have notifications for all the user’s goals, not just the user’s Nectar integration goals. The best way to do that is to subscribe to your existing zeno polling/push notification system. This would be extremely easy for me to configure and users would receive notifications faster and more accurately then with the other options.

Yes, we would need to request permission from the user to receive push notifications. If they granted permission, we would get a [device_token] to send to your API endpoint: https://www.beeminder.com/api/private/device_tokens.json?access_token=[access_token]&device_token=[device_token]. Then, when the user is about to derail on any of their goals, they would receive the zeno notifications on their device.

I just need your permission to use those API endpoints in the Nectar mobile app and the SENDER_ID for the Android platform.

The device token endpoint has nothing to do with zeno notifications, and is private because it’s related to some hokum specific to both the android and ios apps.

Goals, nectar-created or not, will get notifications on the zeno schedule in whatever ways the user has configured their notifications. We don’t currently have a way for an app to register for zeno notifications. Here are your options:

  • If your app sets the zeno_callback_url for a specific goal then you’d get a zeno push specific to that goal. However that’s a field that the user has access to in their settings, and was meant with the idea in mind of the user hacking up their own stuff. You should definitely not overwrite that field if it’s already set, and your app should not count on getting those notifications, or at least be aware that your callback might get ousted if the user is messing with their settings or whatnot.
  • Your app has registered an autofetch_callback_url, which means you get a ping from our servers whenever we want new data for a goal. This is almost equivalent to the zeno schedule. You will get some extra notifications because we check for new data:
    • at the end of the day before the day rolls over to the next calendar day
    • before sending a reminder or zeno
    • whenever the user pushes the Refresh button.

Conclusion: we should consider allowing apps to register a zeno callback url, which would parallel the user’s zeno callback, and give a registered app the ability to subscribe to its users’ zenos.

In the meantime, you can attempt to use the user’s individual goal settings, or you can use the autofetch callbacks to determine when to send alerts (with some additional filtering logic to verify that it is indeed an eep day or whatnot).

1 Like

@bee Thanks again for your response.

OK, that private API endpoint is in a function named saveDeviceTokenToServer, which is called from a function named didRegisterForRemoteNotificationsWithDeviceToken. Because the function has “Remote Notifications” in the name, the device token needs to be sent to a server for push notifications and these were the only two private API endpoints in your iOS app, it seemed logical that the API endpoints were used for your push/zeno notifications.

Users (like @kenoubi) want to get zeno notifications for all their goals without having to install two apps.

This would solve part of the issue, but mobile apps do not have URLs, so developers would have to run their own separate server for push/zeno notifications, which would be prohibitively expensive and complex for most mobile developers (including us).

Again, the easiest solution to enable zeno polling in the Nectar mobile app is to allow Nectar to use your existing push notification system. Notifications are the last feature of both your Android and iOS apps that Nectar does not yet include. With your permission, I would be happy to configure this.

As I said in my e-mails, we would be thrilled if you would consider using Nectar as your official Beeminder app. Beeminder’s recent blog post said you want to include “Mobile-friendlier goal creation” in your iOS app, however Nectar already fully supports adding Beeminder goals. In addition, it would save you a lot of development time and money in the future. The Nectar mobile app has one user interface and one codebase that supports three different platforms. Your existing apps have two user interfaces, two codebases and only supports two platforms. If you wanted to add a new feature to Nectar, you would only have to add it once, whereas with your existing apps you would have to add it twice. This is why I was able to add so many additional features to Nectar. Because your existing apps were made by different developers, they have completely different user interfaces and features (see comparison table in first post), making it very difficult for users to seamlessly switch between your Android and iOS apps.

Running a separate server is part of the “standard” model for implementing push notifications.

@csu Yes of course, but there is no need to reinvent the wheel by creating our own separate server for push/zeno notifications when Beeminder already has a server.

Thanks for all the hard work you’ve been putting into this! I was thinking about push notifications and there are a few things to consider here.

In order to send a push notification to an app, the server sending the notification has to have an SSL certificate installed on it that’s associated with that app in order for the push notification service (APNS in the case of iOS) to accept and deliver the notification. So this presents a fundamental barrier to delivering push notifications to different Beeminder apps for a given platform. Even if you did send the device token to that endpoint and we saved it to the server, we would now have to keep track of which device tokens were associated with which apps, and probably also update the UI to let the user indicate if they no longer wanted to receive zeno’s for the given app. We’d also have to get the certificate and install it on our servers, which wouldn’t be terrible to do once but would get tedious with lots of apps (they also expire every year in the case of APNS). The setup for Android might differ a bit in the details but is essentially the same.

@bee’s suggestions of allowing people to subscribe to zeno notifications would be a workaround, since it would mean that anyone could register a Beeminder app, set up this callback, and then run a tiny server ($5/month) which would have as its only job to receive the callback when a goal gets a zeno alert, host the push certificate, and send the notification to the push notification service.

1 Like

I meant running a separate server shouldn’t be “prohibitively expensive and complex” for developers, considering it’s the standard way of implementing push notifications and most mobile apps have been doing it that way.

+1 for the zeno callback idea. Plus, isn’t https://beemindernectar.herokuapp.com already a backend server with paid-for hosting? Couldn’t the push notification provider server just be added to that without any additional cost?

1 Like

@apb Thanks for your reply.

Given the thousands of hours my team and I have spent on developing Nectar, it is extremely unlikely that anyone else would be interested in developing a mobile app for Beeminder and sending zeno notifications to users.

We cannot generate the certificate for iOS for the same reason that we cannot publish the Nectar mobile app to the App Store. It requires a $99 a year Apple Developer account.

I am not sure how much you know about our team, but @dreev and @bee sponsored us to create Nectar between approximately November 2016 and March 2017. Since then, I (@tdulcet) have completely rewritten Nectar and added many additional features. Before I finish, I would like the Nectar mobile app to include all the features of both Beeminder’s Android and iOS apps. Notifications are of course, the last feature that it does not include.

As I said to @bee, we would be thrilled if you would consider using Nectar as your official Beeminder app. If you choose to do so, setting up push/zeno notifications would not require you to make any changes to your server. I would be happy to configure the Nectar mobile app and I could help rebrand it to Beeminder if needed. You could test it on the Windows Store first, since Beeminder does not currently have a Windows app.

@csu Yes, if Beeminder updated their API to allow developers to subscribe to zeno notifications, then the push notification server could be implemented in Ruby on Rails and added to the Nectar web app, but someone (Beeminder?) would still have to let us use their Apple Developer account. In addition, it would increase the complexity of the Nectar web app, which is limited to just 10,000 database entries. If we went over that, there would be an additional cost. Pull requests welcome!