Question: I'm having some trouble sending push notifications to Android and iOS devices using Django + GCM.

---

Problem 1: Android receive push when in background but the method `onMessageReceived` is not called. So I can't handle the received data. iOS only receive push if the app is opened or minimized, if the app is closed, do not received pushs.

```
@Override
public void onMessageReceived(String from, Bundle data) {
   ....
}

```

Django code:

```
@receiver(post_save, sender=Notification)
def send_push(sender,**kwargs):
n = kwargs.get('instance')
gcm = GCM("API_KEY")
data = {'messageContent': n.message, 'content_available':'true'}
notification = {'body': n.message, 'title': n.title,'sound':''}
topic = n.topic
gcm.send_topic_message(topic=topic, data=data,notification=notification)

```

---

Problem 2: The Android received pushs in background and the method `onMessageReceived` is called (Android OK). But the iOS app does not receive any notifications, opened, closed, minimized. Just wont work.

Django code:

```
@receiver(post_save, sender=Notification)
def send_push(sender,**kwargs):
n = kwargs.get('instance')
gcm = GCM("API_KEY")
data = {'messageContent': n.message, 'content_available':'true',
        'title': n.title, 'sound':'' }
topic = n.topic
gcm.send_topic_message(topic=topic, data=data) 

```

Answer: 
You can do this:

```
>>> def zipp (a,b):
...    return [[x,y] for x, y in zip(a, b)]

>>> zipp(a, b)
[[[1, 2, 3], 'Python'], [[4, 5, 6], 'Java']]

```

> 
> It must become a function...
> 
> 
> 

Note that you use `zip` directly, without defining any extra functions:

```
>>> print(list([x, y] for x, y in zip(a, b)))
[[[1, 2, 3], 'Python'], [[4, 5, 6], 'Java']]

```
I think you do not understand how the function works.
When you call a function, if the function returns a value, the loops will not continue. The `i` are not simultaneously returned.